0

我用代码块检查本地玩家是否通过 Game Center 进行了身份验证

if ([[GKLocalPlayer localPlayer] isAuthenticated]) 
{
    NSLog(@"authenticated");
}

此代码在我第一次使用 GameCenter 登录时运行。当我杀死我的应用程序并重新启动时,它返回 NO(播放器未通过身份验证)

每次启动应用程序时都必须登录吗?还有其他解决方案吗?

4

2 回答 2

0

You have to authenticate localPlayer every time your app becomes active but the user only has to input his user/password info the first time. After that it "remembers" who the user is.

Note that the authentication method in iOS 5 is not the same as iOS 6.

于 2012-12-08T19:44:21.747 回答
0

是的,每次应用启动时都必须调用 authenticatedPlayer。第一次 iOS 会提示用户获得 GameCenter 权限。不用担心调用登录,一旦用户选择允许游戏中心,它会自动登录验证。

于 2012-12-07T11:39:49.057 回答