Hi,
I’m having some real problems getting google play game services to work in my app. The issue is that
gameNetwork.init() seems to hang.
I’ve gone through the steps of adding a new application, adding a new game via the Game Services Icon, linking it and setting the keystore ID correctly.
I’ve now stripped the code down to the bare essentials.
build.settings
settings = { android = { googlePlayGamesAppId = "1054372640256", -- Your Google Play Games App Id }, plugins = { -- key is the name passed to Lua's 'require()' ["CoronaProvider.gameNetwork.google"] = { -- required publisherId = "com.coronalabs", }, }, }
main.lua
local gameNetwork = require "gameNetwork" local init; local function initCallback( event ) if not event.isError then init = true native.showAlert( "Success!", "", { "OK" } ) else init = false native.showAlert( "Failed!", event.errorMessage, {"OK"}) print("Error Code: ", event.errorCode) end end native.showAlert( "Calling gameNetwork.init", "", { "OK" } ) gameNetwork.init( "google", initCallback ) native.showAlert( "Calling login", "", { "OK" } ) local function requestCallback(isError) if (isError) then native.showAlert( "login error", "", { "OK" } ) else native.showAlert( "login sucessful", "", { "OK" } ) end end gameNetwork.request( "login", { userInitiated = true, listener = requestCallback }) native.showAlert( "Calling leaderboards", "", { "OK" } ) gameNetwork.show( "leaderboards" ) --gameNetwork.show( "achievements" )
When I test on the Samsung Galaxy S3 and HTC One, the only native popup I get is:
“Calling gameNetwork.init”
So it looks as if the app is hanging on gameNetwork.init
I’ve tried this on build 2013.1137 and 2013.1191 and both have the same issue.
I am using a game services test account (not published yet) and the apk has not been uploaded to google play (I assume it does not need to be yet).
I really don’t know where to start debugging this.
Any help would be really appreciated!
Cheers,
Anthony