I am developing an app that reports a score to Game Center using the code below (as suggested by Apple).
My problem is that even when my iPhone is in Airplane mode, the app does not trigger any score reporting error. It just goes to the “Submission ok” section of the code.
Any idea why?
Thank you!
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:category] autorelease];
scoreReporter.value = score;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if (error != nil)
{
// handle the reporting error
NSLog(@"Error Descr %@",error.localizedDescription);
NSLog(@"Error Code %@",error.code);
NSLog(@"Error Domain %@",error.domain);
}
else {
NSLog(@"Submission ok");
}
}];
Starting with iOS 5.0, any network errors arising out of
reportScoreWithCompletionHandlerare handled internally by GameKit. This means that developers no longer have to worry about resubmitting scores pending due to network failures. If you’re building with iOS 5.0 and later, the completion handler ofreportScoreWithCompletionHandlerwill not receive any network-related errors.