Game Play Services not showing

Hi all,

Please give me a hint here  :smiley:

I am trying to manage Google Play Game Service in my game (i.e. gameNetwork plugin).

I handled everything in build.settings (added app ID and plugin), but I cannot show leaderboard nor I get popup that I am signed in like in other apps ).

I created 1 leaderboard in Google Developer Console.

Here is my code:

local gameNetwork = require("gameNetwork") local function loadPlayerRequestCallback(event)     playername = event.data.alias     playerID = event.data.playerID end local function gameCenterLoginCallback(event)     gameNetwork.request( "loadLocalPlayer", { listener=loadPlayerRequestCallback } )     return true end gameNetwork.init("google", gameCenterLoginCallback)

Later on in game:show I am calling this:

gameNetwork.request("login", { userInitiated = false })

When user presses GameNetwork Button I am calling this:

gameNetwork.show("leaderboards")

Please help me out here?

Thanks  :slight_smile:

Hi @gogigoranic8,

My first suggestion is to confirm that your game is reaching that code point in the step-by-step process. In other words, add some print() statements and confirm that GPGS is initializing properly, then loading the local player, then logging the player in, then attempting to show the leaderboards. It might not even be reaching that point, in which case you’ll need to back up and figure out why.

Best regards,

Brent

@gogigoranic8,

If you want to see a working code example of GPGS using the Corona SDK Plugin, check out this code I’m sharing:

http://animonger.com/gpgstester/

Hi Animonger,

Thanks!

Why you need to add players ID inside code?

Where I could find players ID?

Adding players ID is just for testing purposes or??

Gogi

Hi @gogigoranic8,

If you are referring to this line on the github requirements readme: Add PlayerIDs to lines 30 and 31 of the ScenePlayersMenu.lua

Then the answer is yes, they are just for testing the loadPlayers command.

You can get the playerIDs of your friends after you log your game into GPGS and then call this loadFriends command.

If you haven’t done so already, check out Rob Miracle’s tutorial on how to setup GPGS with Corona SDK.

Thanks animonger!

Hi @gogigoranic8,

My first suggestion is to confirm that your game is reaching that code point in the step-by-step process. In other words, add some print() statements and confirm that GPGS is initializing properly, then loading the local player, then logging the player in, then attempting to show the leaderboards. It might not even be reaching that point, in which case you’ll need to back up and figure out why.

Best regards,

Brent

@gogigoranic8,

If you want to see a working code example of GPGS using the Corona SDK Plugin, check out this code I’m sharing:

http://animonger.com/gpgstester/

Hi Animonger,

Thanks!

Why you need to add players ID inside code?

Where I could find players ID?

Adding players ID is just for testing purposes or??

Gogi

Hi @gogigoranic8,

If you are referring to this line on the github requirements readme: Add PlayerIDs to lines 30 and 31 of the ScenePlayersMenu.lua

Then the answer is yes, they are just for testing the loadPlayers command.

You can get the playerIDs of your friends after you log your game into GPGS and then call this loadFriends command.

If you haven’t done so already, check out Rob Miracle’s tutorial on how to setup GPGS with Corona SDK.

Thanks animonger!