Does Game Center score syncing work for sandbox accounts?
I'm developing for iOS 6.0 and submitting scores to Game Center.
Everything works fine when I submit a score with an internet connection.
When I turn off my internet connection and submit a score that should
update the leaderboard, the completion handler is invoked without any
error. When I turn the internet connection back on, I'm expecting GameKit
to forward the score to Game Center and for the leaderboard to be updated.
But it doesn't update, not even after a long while (1+ hour).
The player is authenticated when the score is initially submitted and
again when the internet connection is turned back on.
Am I missing something? Does it work for sandbox accounts? My score
submission code is below:
- (void)submitScore:(int64_t)score category:(NSString*)category {
//1: Check if Game Center features are enabled
if (!_gcEnabled) {
return;
}
//2: Create a GKScore object
GKScore* gkScore = [[GKScore alloc] initWithCategory:category];
//3: Set the score value
gkScore.value = score;
//4: Send the score to Game Center
[gkScore reportScoreWithCompletionHandler:^(NSError* error) {
[self setLastError:error];
BOOL success = (error == nil);
if ([_delegate respondsToSelector:@selector(onScoresSubmitted:)]) {
[_delegate onScoresSubmitted:success];
}
}];
}
No comments:
Post a Comment