Gamenetwork does not init

Okay, I have tried it for several hours and with several constellations, but the following things never worked:

gpgs.login() does not bring up a banner or something if the user is logged in, but I am not sure if this has to come up anyway on Android, like it does with Gamecenter on Apple.

gpgs.players.load({listener = loadLocalPlayerCallback}) does not call the listener function. I don’t know if this has to work to make the following things work:

gpgs.leaderbords.show(“xyz”) does not show the leaderboards, nor does .load trigger the listener function

gpgs.leaderboards.submit() does not submit the score

gpgs.achievements.unlock() does not unlock the achievement

… To sum that up, every gpgs-function despite init and probably login don’t seem to work here… I use 2017.3032.

Here is my working GPGS login code:

local function gpgsLoginListener( event ) print( "Login event:", json.prettify(event) ) end local function gpgsListener( event ) print( "Init event:", json.prettify(event) ) if not event.isError then -- Try to automatically log in the user without displaying the login screen print("Trying to login") gpgs.login({ userInitiated = true, listener = gpgsLoginListener }) end end print("Initializing GPGS") gpgs.init( gpgsListener )

If you do not specify userInitiated = true, it will silently log you in.

Rob

Thanks for the code, this is what it prints out from the loginListener:

I/Corona  ( 7984): Login event: { I/Corona  ( 7984):   "errorCode":8, I/Corona  ( 7984):   "errorMessage":"internal error", I/Corona  ( 7984):   "isError":true, I/Corona  ( 7984):   "name":"login", I/Corona  ( 7984):   "phase":"logged in" I/Corona  ( 7984): }

and everytime I try to do something with GPGS, it prints: W/plugin.gpgs( 9729): Not connected

· · · · · · ·

Following this thread, I activated Drive API and Google Play API for the project and now it finally seems to work. I have to make a few test though, but I think that was the problem.

https://forums.coronalabs.com/topic/66420-gpgs-error-8-internal-error-on-login/

Yep. That error is a configuration error which usually relates to the Drive API.

Rob

I had the issue but my issue is little different,
I had imported gpgs plugin in build, added license in config and init in main.

then i require gpgs and try to login as same as n above steps.

But after the login, the response in as follows:

 Login event:    {
I/Corona  (10503):    “errorCode”:4,
I/Corona  (10503):    “errorMessage”:“sign in required”,
I/Corona  (10503):    “isError”:true,
I/Corona  (10503):    “name”:“login”,
I/Corona  (10503):    “phase”:“logged in”
I/Corona  (10503):  }

i am not getting whats wrong or what is left, I am using the latest daily build 2017.3033.

I have also activated drive api and game services api on console too.

Thanks in Advance.

Are you including:

userInitiated = true

???

Rob

No Rob, It was not there before. I was testing and used a lot of things and fortunately it start working bur was not sure of how? Now with your reply, i am sure it was issue with userInitiated=true. So means we need to add this while login now. Thanks for your quick reaponse.