I setup Google Play Game Services and it works and starts with a button to initialize it (sign in button) but if the user signs out then hits the button it doesn’t work (no errors). If the app is restarted the button works again. Here is my code:
[lua]
local playerName
function loadLocalPlayerCallback( event )
playerName = event.data.alias
saveSettings() --save player data locally using your own “saveSettings()” function
end
function gameNetworkLoginCallback ( event )
print(“LOGINCALLBACK”)
gameNetwork.request( “loadLocalPlayer”, { listener=loadLocalPlayerCallback } )
return true
end
function gpgsInitCallback ( event )
print(“INITCALLBACK”)
gameNetwork.request( “login”, { userInitiated=true, listener=gameNetworkLoginCallback } )
end
function gameNetworkSetup ()
if ( system.getInfo(“platformName”) == “Android” ) then
print(“GAMENETWORKSETUP”)
gameNetwork.init( “google”, gpgsInitCallback )
else
gameNetwork.init( “gamecenter”, gameNetworkLoginCallback )
end
end
[/lua]
I call gameNetworkSetup when the button is tapped. This would mean that if the user signed out they wouldn’t be able to access the leader boards anymore until they exit the app. Any help would be appreciated!