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);
}
});
}];
}