开发者

Handling account / user switching for Game Center on iOS 4.1 [iphone]

I recently integrated Game Center support for an iOS game. I'm trying to figure out how to properly handle the following scenario:

1) User goes into game and logs into Game Center

2) User backgrounds the game and switches to the Game Center application

3) User signs out of Game Center and signs in with a different account

4) User brings the game back into the foreground

5) User hits a button in-game to bring up achievements view

Now at this point, the behaviour seems to be undefined when running on iOS 4.1. If I don't attempt to manually re-authenticate with game center, then the achievements view doesn't display anything. If I do re-authenticate when the game is foregrounded, then I either get a crash when bringing up the achievements view (happens on device) or the achievements view still shows the stats from the previous player (simulator). As an additional note, iOS 4.2+ seems to be fine since the user is re-authenticated automatically when the game is foregrounded.

The official documentation says: "Automatically authenticating the local player after moving to the foreground is provided only on iOS 4.2 and later. On iOS 4.1, there is no correct way to authenticate the local player after your application moves to the background." This doesn't explain how to handle such situations in 4.1.

Does anyone know how to ha开发者_StackOverflow社区ndle this scenario properly? Is there a standard way of doing things?

Any help would be appreciated. Thanks!

Mark

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜