views:

12

answers:

1

From the Getting Started with Game Center doc...

Always check for network errors when reporting achievement progress to Game Center. If there
was an error, it is important for your app to store any progress updates for later retransmission.
This retransmission should occur at the soonest opportunity and without requiring separate
user action.

I'm about to begin building a game for the iPhone that leverages the Game Center capabilities and I'll need to monitor the transmission of the data as I attempt to send it to the Game Center. I'm relatively new to iOS development and I would probably handle this using some polling approach and periodically checking if there's any data that needs to be retransmitted. I'm about to begin researching some good ways to handle this and thought I'd post this question in the meantime. What are some good ways to handle network errors when sending data to the Game Center server? Are there any APIs or design patterns I should use for this?

Thanks so much in advance for your wisdom!

A: 

So I found out that most of the Game Center objects (including achievements and scores) support the NSCoding protocol. As such, the suggested approach to recovering from a network error during transmission is to archive the data (using NSCoding protocol) and un-archive the data when your app is next launched.

BeachRunnerJoe