Transferring files between users

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)

If you think there is a bug you should report it

https://goo.gl/forms/QjOJsFGghSEQqkJW2

Hi,

The next major update to Coronium Core will have a user management component which would make this a fairly simple process. All scripting is based in Lua, and just off the top of my head, I don’t think you would need to do any server-side coding when pairing the file transfer when using the user management component. This also allows you to transfer many different file types.

-dev