iOS 开发:验证 Game Center 用户的奇怪问题

发布于 2024-10-10 09:51:02 字数 661 浏览 0 评论 0原文

我正在构建一款支持 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. 取消

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

有谁知道为什么会发生这种情况或者我该如何解决它?

预先感谢您的智慧!

I'm building an iPhone game that supports Game Center (GC). When the app launches, I try to authenticate the local player...

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

Everything seemed to be working well. If the user wasn't signed into GC when the app launched, the app would display a dialog box giving them three options...

  1. Sign into existing account
  2. Create an account
  3. Cancel

This is the desired behavior, but while I was testing, I clicked the "Cancel" option and now the authentication process errors out every time with the following error "The requested operation has been cancelled." Even when I delete the app and reinstall it, it still errors out and that dialog box never pops ups now.

Does anyone know why this is happening or how I can fix it?

Thanks in advance for your wisdom!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月牙弯弯 2024-10-17 09:51:02

事实证明,这是苹果无证行为。

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

去图吧。

It turns out that is apple undocumented behavior.

After 3 times a user press cancel in a row, he has to go to the Game Center app and connect from there.

Go Figure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文