代码之家  ›  专栏  ›  技术社区  ›  Joseph Tura

使用Game Center验证本地玩家

  •  6
  • Joseph Tura  · 技术社区  · 15 年前

    我正在尝试验证游戏中心的玩家身份。然而,苹果提供的代码

    - (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]);
             }
         }];
    }
    

    如果按retry,将出现以下错误:

    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.}
    

    3 回复  |  直到 9 年前
        1
  •  7
  •   Joseph Tura    15 年前

    我在连接游戏中心时发现的一个可能的问题是,你的日期可能在设备上有误。检查您的日期是否为实际的当前日期。不知何故,Game Center不允许来自日期不正确的设备的连接。

        2
  •  1
  •   KudoKid    13 年前

    您可以尝试将模拟器完全重置为默认值。 它为我工作,一旦它被重置,我的iDevice再次工作。

    iOS模拟器->重置内容和设置->单击重置按钮。

    我希望这有帮助。

        3
  •  0
  •   Steve Mulligan    15 年前

    编辑:我将部署目标更改为3.0“项目-编辑活动目标-iOS部署目标”

    然后我可以选择4.1模拟器为我的活动可执行文件,我可以登录和一切工作。我猜是4.2沙盒的问题。。。

    推荐文章