ios – 使用Game Center验证GKLocalPlayer

ios – 使用Game Center验证GKLocalPlayer,第1张

概述我正在尝试使用Game Center验证GKLocalPlayer.但是,Apple提供的代码 - (void) authenticateLocalPlayer{ [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { if (error == nil) @H_404_1@我正在尝试使用Game Center验证GKLocalPlayer.但是,Apple提供的代码
- (voID) authenticateLocalPlayer{    [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {         if (error == nil)         {              // Insert code here to handle a successful authentication.              NSLog(@"Logged in.");         }         else         {             // Your application can process the error parameter to report the error to the player.             NSLog(@"%@",[error description]);         }     }];}

似乎没有为我做的伎俩.我总是收到警告“无法连接到Game Center服务器”.选择“重试”或“取消”.两个NSLog语句都没有被执行,所以我猜到甚至没有触发completionHandler.

如果我按重试,我会收到以下错误:

Error Domain=GKErrorDomain Code=7 "The requested operation Could not be completed because local player is already authenticating." UserInfo=0x8915f80 {NSLocalizedDescription=The requested operation Could not be completed because local player is already authenticating.}

任何人都知道出了什么问题?

解决方法 我发现连接到Game Center时遇到的一个问题是您的日期可能在设备上出错.检查您的日期是否是实际当前日期.不知何故,Game Center不允许来自日期不正确的设备的连接. 总结

以上是内存溢出为你收集整理的ios – 使用Game Center验证GKLocalPlayer全部内容,希望文章能够帮你解决ios – 使用Game Center验证GKLocalPlayer所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1114622.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存