So I am sending scores to the GC leaderboards, I receive no errors and the scores apprently send but I still see no scores listed in the leaderboards! The leaderboard itself is listed in Game Center there are just no scores.
According to a Google search and a question on here this could be resolved by attempting to log scores with more than one account. I have tried on three different accounts now both in Simulator (iOS5) and on my iPhone; none of them show any errors when submitting the scores.
The code that sends the score is here:
- (void)reportScore:(NSString *)identifier score:(int)rawScore {
GKScore *score = [[[GKScore alloc] initWithCategory:identifier] autorelease];
score.value = rawScore;
[scoresToReport addObject:score];
[self save]; // Save here even though we save again in didEnterBackground, just in case of crash...
if (!gameCenterAvailable || !userAuthenticated) return;
[self sendScore:score];
}
- (void)sendScore:(GKScore *)score {
[score reportScoreWithCompletionHandler:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^(void)
{
if (error == NULL) {
NSLog(@"Successfully sent score!");
[scoresToReport removeObject:score];
} else {
NSLog(@"Score failed to send... will try again later. Reason: %@", error.localizedDescription);
}
});
}];
}
It suddenly started working (without any code change or even a recompile). I figure it takes a while for the leaderboards to actually appear, for me about 18 hours.
Scores submitted within this time will still record, they just wont be visible instantly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With