Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Game Center: Scores not showing on leaderboard in sandbox

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?

like image 726
Justin Kredible Avatar asked Jan 03 '12 23:01

Justin Kredible


2 Answers

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.

like image 52
CStreel Avatar answered Nov 09 '22 06:11

CStreel


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.

like image 3
erkanyildiz Avatar answered Nov 09 '22 05:11

erkanyildiz