iphone - iOS 开发 : Strange problem with authenticating Game Center user

标签 iphone ipad ios gamekit game-center

我正在构建支持 Game Center (GC) 的 iPhone 游戏。当应用程序启动时,我尝试对本地播放器进行身份验证...

 if([GKLocalPlayer localPlayer].authenticated == NO)
    {
        [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) 
         {
             [self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
         }];
    }

一切似乎都运转良好。如果应用程序启动时用户未登录 GC,应用程序将显示一个对话框,为他们提供三个选项...

  1. 登录现有帐户
  2. 创建一个帐户
  3. 取消

这是期望的行为,但在我测试时,我单击了“取消”选项,现在身份验证过程每次都会出错,并显示以下错误“请求的操作已被取消。”即使我删除应用程序并重新安装它,它仍然会出错,并且该对话框现在再也不会弹出了。

有谁知道为什么会这样或者我该如何解决?

提前感谢您的智慧!

最佳答案

事实证明这是苹果未记录的行为。

用户连续按取消 3 次后,他必须转到 Game Center 应用并从那里连接。

去图。

关于iphone - iOS 开发 : Strange problem with authenticating Game Center user,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4576032/

相关文章:

iphone - UIGraphicsGetImageFromCurrentImageContext返回意外的nil

ios - 当我切换沙箱环境时,PayPal iOS-Sdk 发出警报

jQuery 可以在电脑上运行,但不能在 iPad 上运行?

iphone - 如何将一个 iPhone 应用程序集成到另一个应用程序中

ios - 如果字符串为空则抛出异常

ios - iPad 在 iOS 6 上使用 iPhone Storyboard而不是 iPad Storyboard

ios - 传递数据时有条件的Segue?

ios - UIButton 和 UITextField 不响应作为 UIViewController 的一部分

iphone - 缓存的 UITableView 元素

html - iPad 显示的内容大于屏幕尺寸/视口(viewport)