Does firebase storage plugin work for others? If I initialise the bucket without timer.performWithDelay, then the app hangs in firebaseStorage.init().
And, if I initialise the bucket with timer.performWithDelay then the app doesn’t hang, but eventually nothing gets uploaded and upload listener will never get called back. Storage rules should be fine and allow read, write and authentication disabled. Also the file to be uploaded should be in system.DocumentsDirectory.
– Initialize
firebaseStorage = require “plugin.firebaseStorage”
timer.performWithDelay( 100, function() firebaseStorage.init() end)
– Upload
firebaseStorage.upload( system.pathForFile(“file.db”, system.DocumentsDirectory), “file.db”, function(e)
print(“firebaseStorage.listener”) – this never gets called
if (not e.error) then
urlForFile = e.downloadURL
native.showAlert( “Uploaded”,urlForFile, {“OK”} )
else
native.showAlert( “Error”,e.error, {“OK”} )
end
end)