iOS GameCenter leaderboard no ranking

Hello people,

I implemented GameCenter for iOS on Corona. When I put game on real device you can see successful login on Game Center. Problem is when you open to see your score, there is show no ranking  and sometimes game is crush. So, I want to share my code with you to see what’s going on.

mainmenu.lua (this is a script before starting playing a game)

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("gamecenter", gameCenterLoginCallback)

restart.lua (this is a script when you lose on game, there you can see your score and highscore and there is a Game Center button)
 

local gameNetwork = require( "gameNetwork" ) function onClickGameCenter()  gameNetwork.request("setHighScore", {         localPlayerScore = {             category="HERE IS MY ID NUMBER OF LEADERBOARD",             value=100 --for example this value isn't read on leaderboard         }}) gameNetwork.show( "leaderboards", { timeScope="AllTime" } ) end

That is all code which I used for Game Center. Am I missed something? 

Thanks and kind regards

Dario

When testing iOS GameCenter using a developer profile (and perhaps even an AdHoc profile), you are in Apple’s GameCenter Sandbox. You have to have a different AppleID for the sandbox than you do your production GameCenter. In addition there has to be a couple of different scores posted and it can take a little while to show up. It’s a bit of a challenge to test.

Rob

I already have sandbox test profile and I tested with that profile. Which reason might be of crushing game when I go into leaderboard?

Take a look at the gameNetowkr.show command again in the documentation… I do not see a way to pass a time scope parameter.  that may be why it is crashing.  

gameNetwork.show( "leaderboards", { leaderboard = { category = "com.appledts.EasyTapList" }, listener = showLeaders } )

Also, you may not want to call gameNetwork.show right after a request, since the data may not be available yet.

When testing iOS GameCenter using a developer profile (and perhaps even an AdHoc profile), you are in Apple’s GameCenter Sandbox. You have to have a different AppleID for the sandbox than you do your production GameCenter. In addition there has to be a couple of different scores posted and it can take a little while to show up. It’s a bit of a challenge to test.

Rob

I already have sandbox test profile and I tested with that profile. Which reason might be of crushing game when I go into leaderboard?

Take a look at the gameNetowkr.show command again in the documentation… I do not see a way to pass a time scope parameter.  that may be why it is crashing.  

gameNetwork.show( "leaderboards", { leaderboard = { category = "com.appledts.EasyTapList" }, listener = showLeaders } )

Also, you may not want to call gameNetwork.show right after a request, since the data may not be available yet.