5
votes

I'm creating game like application supporting Game Center. And I have a problem with reporting score to leaderboard when the player is authenticated to gamecenter correctly but the network (wifi or cellular) is not available in the time when I want to report my score.

My app is for iOS 5.0 and greater and according to the documentation - Leaderboards - it should work like they say - I use only the function

- (void)reportScoreWithCompletionHandler:(void (^)(NSError *error))completionHandler and 

and

If for some reason the score could not be reported because of a network error, Game Kit automatically resends the data when the network becomes available.

BUT when I turn off wifi, play my game and report score in this offline mode, my score is not reported when I go back online! :( The same problem I have with my achievements. Is there any trick or known problem? Or is this functionality available only for live appliacations and not for testing?

Thank you very much.

2

2 Answers

0
votes

I've been seeing some similar issues. This isn't an answer, but may point to the problem. Contrary to the answer from NathanChristie, you can be authenticated when WiFi is disabled as I've just tried the same thing using Airplane Mode and was able to get my user authenticated even without the network. What also happens is that Game Center appears to have an old verison of my achievements cached up and displays those when asked. It may be that if you try to report and achievement or leaderboard update and the cached version of the data doesn't recognise it then it will ignore the update. If I get any more info, I'll update.

-1
votes

With your internet connection disabled, you cannot authenticate with Game Center. If there is never any authentication, you cannot take advantage of Apple's automatic resubmit. They support the use case where the user has successfully authenticated and then the network becomes unavailable.

Basically if you're calling the reportScore:forLeaderboardID: after you've authenticated, regardless of whether you have a network connection or not, your scores object should be automatically submitted (at some undefined time / interval) by Apple.