Hi guys,
I’d like to use gpgs but I’ve got some questions.
-
First of all will these two plugins work with each other?
[“plugin.google.play.services”] = { publisherId = “com.coronalabs”, supportedPlatforms = { android=true } }, [“plugin.gpgs”] = { publisherId = “com.coronalabs”, supportedPlatforms = {android=true} },
The “plugin.gpgs” is for the leaderboards etc, but the only reason I’m adding the first plugin is because it was require if you are using plugins like Flurry and Applovin. It’s probably a silly question, because I’m pretty sure it would work but I’d just like to get some confirmation
-
My second question is about a piece of code to save games using snapshots,:
local function gpgsSnapshotAfterSaveListener( event ) native.showAlert( “Snapshots”, "Saving was " … ( event.isError and “unsuccessful” or “successful” ) … “.”, { “OK” } ) end local function gpgsSnapshotOpenForSaveListener( event ) if not event.isError then event.snapshot.contents.write( data ) – Write new data as a JSON string into the snapshot gpgs.snapshots.save({ snapshot = event.snapshot, description = "Save slot " … snapshotFilename, listener = gpgsSnapshotAfterSaveListener }) end end gpgs.snapshots.open({ – Open the save slot filename = snapshotFilename, create = true, – Create the snapshot if it’s not found listener = gpgsSnapshotOpenForSaveListener })
In the event.snapshot.contents.write function you have to pass in a JSON string, but I’m not entirely sure if it’s the same as a JSON table or not. I’m using Rob Miracle’s loadsave module and would like to get that data into the snapshot, how would I do that? The module saves a lua table to a json table and places it into the Documents folder of your app
Thanks guys