I think it might be a bug with the library since everything used to work previously.
Apple’s Game Kit Programming Guide suggests the function to use to submit scores to Game Center, but it does not work for some reason. When Wi-Fi is turned off but user is authenticated it behaves as if the score was sent, however, it obviously isn’t…
Code:
- (VOID) reportScore: (int64_t) score forCategory: (NSSTRING*) category
{
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:category] autorelease];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler:^(NSERROR *error) {
IF (error != NIL)
{
// handle the reporting error
}
}];
}
It used to work exactly as it should. However, I am now testing one of my apps to try to find out why there is a minor bug with the score submission and this function doesn’t function well.
When a user opens the game, logs in to Game Center and then closes it and turns the Wi-Fi off, then opens the game again – it authenticates him OK to the Game Center (since he did not log out). However, when calling the above mentioned function the error is not returned! It says that the score is submitted even though it obviously isn’t.
Did anyone else experience this problem with the score submission to Game Center?
I also have topic dedicated to this on my
blog, please reply wherever you feel easier