Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

GPGS connects, but doesn’t login
Started by philipp3 Nov 08 2018 09:01 AM

1 reply to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

philipp3

[GLOBAL: userInfoPane.html]
philipp3
  • Enthusiast

  • 60 posts
  • Corona SDK

Hello,

 

As I want to update to GPGS V2, I need to check its functionality.

 

The following was already the case with GPGS V1:

When I want to test the game, the dialogue "Connecting To..." pops up, turns to a green Google Play box, a loading circle appears and disappears abruptly. I think it wants to log in my user, but cancels for some reason. When I call gpgs.leaderboards.show("") then, nothing happens.

When I download the same game from the Play Store, it logs in fine: The dialogue that comes from the top and says "Welcome back, xyz-user" shows, and the leaderboard is able to open.

 

The loginCallbackGpgs() gets called, the loadLocalPlayerCallback() doesn’t get called.

 

This is the code that I use (V2):

local function loadLocalPlayerCallback(e)
    --- this does not get called
end

local function loginCallbackGpgs(e)
    --- this gets called successfully
    gpgs.players.load({listener = loadLocalPlayerCallback})
end

gpgs.login({userInitiated = true, listener = loginCallbackGpgs})


--- then some time later:

function showLeaderboards()
    gpgs.leaderboards.show("xyz")
end


[TOPIC: post.html]
#2

steinovehelset

[GLOBAL: userInfoPane.html]
steinovehelset
  • Observer

  • 14 posts
  • Corona SDK

@philipp3

Can you add this line to the "loginCallbackGpgs" function?
print( json.prettify(event) )

 

This way you can see if you have actually been authenticated. "loginCallbackGpgs" will be called even if there is an error. So you need to check inside this function if you're connected or what.




[topic_controls]
[/topic_controls]