Hello,
I am currently having an issue/roadblock using the Scott Firebase Database plugin. The question is, how can i get only the value of a field located in the firebase database. example: If i write to the database…
local totalCoins = 5 firebaseDatabase.set(firebaseAuth.getUID(), {coins = totalCoins}, function (event) if(event.isError) then native.showAlert( "Error", event.error , {"Ok"} ) end end)
The info above writes great to firebase database and shows “coins = 5” online.
When i use the following information to Get the number/value of coins, nothing happens
firebaseDatabase.get(firebaseAuth.getUID(), function (ev) if(ev.isError) then native.showAlert( "Could not Get Data", ev.error , {"Ok"} ) else native.showAlert( "Data received", json.encode( ev.coins ) , {"Ok"} ) end end)
I need a way to only “get” the number of coins from the firebase database.
Any help would be greatly appreciated!