Offline Game Center

This looks like a handy solution to The Offline Problem you’ve no doubt encountered with your Game Center implementations:

Synchronizing Offline Game Center Achievements and Scores

Last post I was talking about removing OpenFeint and using Steffen Itterheim’s GameKitHelper class. As I started testing I came across many issues on my 4.x devices. It didn’t have anything to do with his library, but more to do with the inconsistent error reporting on many of the Game Center callbacks when the device was offline. Thus I would get inconsistent caching and notifications on the game center server. After struggling for 2 days I decided I was going to rewrite the module and take a different approach.

So DDGameKitHelper was born. My version keeps a permanent local cache of all achievements earned and each category’s best score achieved. Then anytime Game Center comes back online I synch between my local cache and Game Center, filling in the missing pieces on both sides. I never remove anything from my local cache. So if an achievement is reported on game center but not locally, I re-cache it. If it’s local but not in game center, I report it. This allows a fresh install of the app to automatically get all achievements and scores the first time it starts up.

It would be nice to have a standardish solution for 4.x + 5.x support here rather than everyone rolling their own, so we certainly encourage you to check it out on github and adopt it if convenient!

Alex | December 24, 2011

Leave a Reply