iOS 开发:验证 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,则应用程序将显示一个对话框,为他们提供三个选项...
- 登录现有帐户
- 创建帐户
- 取消
这是所需的行为,但在测试时,我单击了“取消”选项,现在身份验证过程每次都会出错,并显示以下错误“请求的操作已被取消”。即使我删除该应用程序并重新安装它,它仍然会出错,并且该对话框现在永远不会弹出。
有谁知道为什么会发生这种情况或者我该如何解决它?
预先感谢您的智慧!
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...
- Sign into existing account
- Create an account
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,这是苹果无证行为。
用户连续按取消键 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.