I’m using the Firebase.database plugin and I am able to write values to the database, but it only ever writes 2 children to the parent node. My [current] code is below. I’ve tried this at least 5 different ways and it always writes the created value and the isPaid value.
It doesn’t matter if I pass every value in the 1st set statement, make 3 update statements, or what order I pass them in… The result is always the same. I get a parent node with create and isPaid values (see attached screenshot). Bombs and rank will never save as strings or integers.
I’ve also tried the firebase standalone plugin to no avail. Basically, I just want to add default values for a user when they register, that will be updated in other areas of the app.
<lua>
– HERES WHAT I WANT TO DO
local newUserData = { created = “07/19/2017”, bombs = “5”, rank = 1, isPaid = false }
firebaseDB.set(firebaseAuth.getUID(), newUserData, function (event)
if(event.isError) then
native.showAlert( “Error”, event.error , {“Ok”} )
end
end)
</lua>
<lua>
– ALSO TRIED THE STANDALONE PLUGIN
local newUserData = { created = “07/19/2017”, bombs = “5”, rank = 1, isPaid = false }
firebase.uploadData(firebaseAuth.getUID(), newUserData, function ( event )
if(event.isError) then
native.showAlert( “Error”, event.error , {“Ok”} )
end
end)
</lua>