Added support for Kinvey and Firebase to:
https://github.com/KosiDossApps/gideros_restful_apisHere's a quick video that shows writing/reading lua tables to/from Firebase. When the app runs, data immediately shows up in my desktop web browser.
Kinvey & Firebase make it very easy to read and write lua tables to the cloud. For example, the following writes a table (the 3rd argument) to the "example" collection and names the table "mydata".
kinvey:create("example", "mydata", { name="myname", a=4, b=5, list={ 34, 35, 36 } }, handler) |
Here's a firebase example which writes a table to "new/data":
firebase:write("new/data", { gideros = "Gideros Mobile", thisIs = { anExample = { ofANested = "table" } } }) |
You can read the whole table like so:
firebase:read("new/data", function(r) ... r.data will contain the table ... end) |
You can also retrieve just a portion of the table:
firebase:read("new/data/thisIs/anExample") ----> returns { ofANested = "table" } in the response |
The example uses my account at:
http://gamma.firebase.com/ndoss. If you point your web browser to that location, you can can see the data that's been written.
--ND
Comments
Likes: anefiox
If I add some print statements for debugging in the handler, r.data is a table, but there seems to be nothing inside it if I try to iterate over the pairs. (On the PC, the game state loads as there is a ents object in r.data.)
--------------- ping
ERROR
URL: https://baas.kinvey.com/appdata/kid1497/
--------------- getUser
ERROR
URL: https://baas.kinvey.com/user/kid1497/4fc4750ec9f1ba140b000226
Also interesting, sending information seems to work correctly (the create call).