游戏中心验证错误
我试图调用游戏中心的身份验证方法,但是没有出现身份验证屏幕,并且回调返回错误:“请求的操作已被取消”。
代码:
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
{
NSDictionary *userInfo = nil;
if (error == nil) {
NSLog(@"Game Center successfully authenticated");
}
else {
userInfo = [NSDictionary dictionaryWithObject:error forKey:@"NSError"];
}
[[NSNotificationCenter defaultCenter] postNotificationName:Notification
object:self
userInfo:userInfo];
}];
知道什么会导致这个问题吗?
I'm trying to call the authentication method of game center, however no authentication screen comes up and the callback return with an error : "the requested operation has been canceled".
The code :
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
{
NSDictionary *userInfo = nil;
if (error == nil) {
NSLog(@"Game Center successfully authenticated");
}
else {
userInfo = [NSDictionary dictionaryWithObject:error forKey:@"NSError"];
}
[[NSNotificationCenter defaultCenter] postNotificationName:Notification
object:self
userInfo:userInfo];
}];
Any idea what can cause this issue ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 iOS 4.2 中,当用户取消登录 Game Center 时,尝试 3 次后会返回该错误。您可以通过使用 Game Center 应用程序登录来解决该错误,然后再次尝试您的应用程序,您应该在应用程序中看到来自 Game Center 的欢迎返回消息
In iOS 4.2 when a user cancels the login to Game Center, after 3 attempts that error is returned. You can resolve the error by logging in using the Game Center app, then try your app again, you should see the welcome back message from Game Center in your app
在测试游戏中心是否在特定设备上可用后,您应该执行类似的操作:
You should do something like that after you have tested if game center is available on the specific device: