hansemannn / titanium-firebase-storage

Use the Firebase Storage SDK in the Titanium SDK 🚀
Other
5 stars 3 forks source link

Android version #4

Open m1ga opened 7 months ago

m1ga commented 7 months ago

methods:

firebase.storage-android-1.0.0.zip

var myBlob = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "images/default.png");
if (myBlob.exists()) {
    FirebaseStorage.create();
    FirebaseStorage.upload({
        data: myBlob.read(),
        callback: function(e) {
            if (!e.success) {
                Ti.API.error('Error: ' + e.error);
            }
                Ti.API.info('Upload completed! Download-URL: ' + e.downloadURL);
        }
    });
}