26

I'm developing a Game Center enabled game and I'm running into an issue in the sandbox environment. I can successfully report the score without error. However, when I show the leaderboard, there are no scores visible. To verify that the score actually got there, I query the local user's score with the following code:

-(void)retrieveLocalScoreForCategory:(NSString *)category
{
    GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
    leaderboardRequest.category = category;

    [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores,NSError *error) 
     {
         [self callDelegateOnMainThread: @selector(localPlayerScore:error:) withArg: leaderboardRequest.localPlayerScore error: error];
     }];
}

In my delegate I log the score to the console and I can see the correct score got there. I have already verified that I'm showing the leaderboard using the correct leaderboard category id (I only have one).

Does anyone know why my score isn't visible on the leaderboard in the sandbox environment immediately? Is there a delay before the score shows up?

Justin Kredible
  • 8,354
  • 15
  • 65
  • 91

2 Answers2

56

I ran into the same issue with projects I've worked on.

The GC Leaderboards (Sandbox/live) will only return scores if there are two or more players on the Leaderboards.

So make sure you either submit the score with 2 different accounts on one 1 device or 2 different accounts on separate devices.

CStreel
  • 2,642
  • 2
  • 19
  • 37
  • created another user on my 3GS test device and it works now. Thanks. – Justin Kredible Jan 04 '12 at 00:45
  • 4
    +1 - I must have looked at hundreds of incorrect reasons, this one was critical for me saving my hair. My hairline thanks you. – Stephen Morris Jan 05 '12 at 18:05
  • @StephenMorris haha no problem mate, glad i could help. I only found out about this problem from fellow work mates when i first encountered – CStreel Jan 05 '12 at 22:11
  • Saved my hair too. I guess it is because they need to add the "Top X%". They can't calculate that with one player in the leaderboards :p – Mazyod Feb 13 '12 at 10:29
  • 4
    I have used two different accounts on two different devices with no success, what's the problem? – DreamOfMirrors Mar 15 '12 at 15:47
  • @DreamOfMirrors please make your own question for more details, but my guess without a detailed description of the problem is that you are incorrectly reporting to the GC Leaderboards. – CStreel Mar 28 '12 at 02:21
  • @CStreel, I have successfully resolved the problem. As you have stated I was incorrectly reporting the scores beaceuse I was using leaderboards ID with different case. – DreamOfMirrors Mar 28 '12 at 09:40
  • Fixed it for me on iOS 5 and iOS 6. +1 Thanks very much :) – Luke Antins Sep 23 '12 at 02:26
  • I created 2 different test users and testing with sandbox... and i posted 3 scores from each user..... still not seeing scores in game center..... I'm little worried :( – Satyam Jan 17 '13 at 16:25
  • refer to previous comments, ensure you are reporting to the leader boards correctly – CStreel Jan 19 '13 at 10:08
  • There seems to be a delay between the report of the score and the actual leaderboard update. It took for me more than 10 hours to receive the updated scores on all envolved Game Center sandbox accounts. – shadowhorst Mar 05 '14 at 10:33
3

Try changing timeScope.

Sometimes GKLeaderboardTimeScopeAllTime & GKLeaderboardTimeScopeToday returns nothing but GKLeaderboardTimeScopeWeek works fine. I think it's a GC sandbox server problem.

Hear us Apple: use some of those billions to make your web services better.

erkanyildiz
  • 13,044
  • 6
  • 50
  • 73