DeviceSpace

DCS Phonegap Device Space Plugin
DonVaughnDcs0.0.11
platforms: ios
$ cordova plugin add de.dcsfuerth.pgplugin.devicespace

DCS-Fürth Device Space Phonegap Plugin


Phonegap Version

Phonegap 3.0

Device Support
  • iOS
Install (from the root directory of your project - i.e., above /platforms):
cordova plugin add https://github.com/DonVaughnDcs/pgplugin-devicespace.git
Remove (from the root directory of your project - i.e., above /platforms):
cordova plugin rm de.dcsfuerth.pgplugin.devicespace
Variable Scope

deviceSpace is assigned to the window object

Permissions
  • iOS - No permissions are required.
DeviceSpace

The deviceSpace object contains the device's total and free space (for permanent storage).

Properties
  • deviceSpace.totalBytes
  • deviceSpace.freeBytes

These are updated after initilization and each time the deviceSpace.get() method is called.

Methods
  • deviceSpace.get(success, error)

    • The success callback receives "totalBytes" and "freeBytes"
    • The error callback receives an error message string
Example
deviceSpace.get(
    function(totalBytes, freeBytes) {
        console.log("Total bytes: " + totalBytes);
        console.log("Free bytes: " + freeBytes);
    },
    function(errorMessage) {
        console.log("ERROR: " + errorMessage);
    },
);