trigger.io

check available space for iOS/android device in trigger.io app


in our trigger.io app we're using modules file and camera and some users having problems with app because they don't have enough space available on their devices.

is there a way to check and notify a user that their device don't have available space?


Solution

  • If you update to v2.13 of the file module you can do:

    forge.file.getStorageInformation(function (info) {
        forge.logging.log("Total space on device: " + info.total);
        forge.logging.log("Free space on device: " + info.free);
    }, function (e) {
        // handle any errors
    });
    

    The success callback also includes information for app and cache directory sizes, for more information check out the module documentation.