Is there an example on how to implement the auto login for GPGS correctly at app start and when the user is clicking a button to access GPGS somewhere?
Same for GameCenter?
I somehow have the problem the GPGS is not active at first start of the app… only when I go outside of the app and returning the GPGS sometimes can be accessed and a leaderboard can be shown.
I have the same problem because I always get into the error state it seems. With this:
gpgsInitListener = function ( event ) if not event.isError then if ( event.name == "init" ) then -- Initialization event -- Attempt to log in the user globalData.gpgs.login( { userInitiated=true, listener=gpgsInitListener } ) \_G.FirstTime = 1 elseif ( event.name == "login" ) then -- Successful login event --print( json.prettify(event) ) if \_G.loggedintogpgs==0 then \_G.loggedintogpgs=1 end end else performWithDelay (6000,function() globalData.gpgs.init( gpgsInitListener ) end,1) end end globalData.gpgs.init( gpgsInitListener )
The app always tries to init after 6 seconds… is there a way to get more info on the error which is causing this?
The attempt to sign in to the Games service failed. For example, this might happen if the network is flaky, or the user’s account has been disabled, or consent could not be obtained.
It might be worth a deeper dive into a google search for “Google Play Games Service error 10002” and see if there are more results (I just picked off the 1st page).
I have the same problem because I always get into the error state it seems. With this:
gpgsInitListener = function ( event ) if not event.isError then if ( event.name == "init" ) then -- Initialization event -- Attempt to log in the user globalData.gpgs.login( { userInitiated=true, listener=gpgsInitListener } ) \_G.FirstTime = 1 elseif ( event.name == "login" ) then -- Successful login event --print( json.prettify(event) ) if \_G.loggedintogpgs==0 then \_G.loggedintogpgs=1 end end else performWithDelay (6000,function() globalData.gpgs.init( gpgsInitListener ) end,1) end end globalData.gpgs.init( gpgsInitListener )
The app always tries to init after 6 seconds… is there a way to get more info on the error which is causing this?
The attempt to sign in to the Games service failed. For example, this might happen if the network is flaky, or the user’s account has been disabled, or consent could not be obtained.
It might be worth a deeper dive into a google search for “Google Play Games Service error 10002” and see if there are more results (I just picked off the 1st page).