Question

I have problem to send my score data to the game center leaderboard on my iOS game. I use the cocos2d engine.

I followed the instruction on Apples checklist: https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/LeaderBoards/LeaderBoards.html#//apple_ref/doc/uid/TP40008304-CH6-SW14

I checked BundleIDs, set up the Leaderboards on iTunesConnect.

On the application startup I sign in the local player. So I can see on the top of the screen "Welcome back ..." and it also says that I'm in the Sandbox.

To send the score I use the best practice code from Apple. When I debug the code I can see that there is no error with sending the score data. I also checked several times the spelling of the Leaderboard ID.

When I open the game center app or I show the leaderboard view controller in my app, I don't see any scores at all. I also checked that I loged in with my Sandbox account.

Any suggestions?

Andy

Was it helpful?

Solution

It seems to be that the sandbox leaderboard server from Apple had have a problem. Without any changes on my code it worked one day later.

OTHER TIPS

I faced with same issue and it took me some hours just to figure out that I was setting wrong score range. Please be careful about this, especially when you are storing float or decimal value not integer.

For example, when you want to store score with format Fixed point - to 3 Decimals, score = 1.234 in this case

When storing value to leaderboard, you already multply the score by 1000 to have the integer value:

int64_t gcScore = (int_64t)(score * 1000);

Hence, if you planed to store the value of 1.234, the real value saved to leaderboard should be 1234. In this case, if you set the score range from 0 to 100, much greater than 1.234, but the score is not saved because 100 < 1234.

GKLeaderBoardViewController class for counting Highest Score.For more details I suggested you to read below link.Thanks

http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKLeaderboardViewController_Ref/Reference/Reference.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top