iPhone GameKit:与沙盒通信 - GKErrorDomain 代码 3

发布于 2024-09-27 09:25:49 字数 1152 浏览 5 评论 0原文

有人有过 GameKit GKErrorDomain Code 3 的经验吗?当我尝试将分数上传到沙盒中的排行榜时,我收到错误消息。 iOS 参考库只是说指示与游戏中心通信时发生错误 这里是完整的错误消息:

Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x75e4eb0 {NSUnderlyingError=0x7531e00 "The operation couldn’t be completed. status = 5053", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server

环境:

  • 请求是从 4.​​1 模拟器
  • GameKit 发出的,已验证本地玩家谁已登录沙盒
  • 名称为“Standard”的排行榜已在 iTunes connect 上创建
  • 我可以在模拟器中浏览网页

这是我用来上传分数的代码

    GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"Standard"] autorelease];
    scoreReporter.value = 10;
    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) 
     { 
    if (error != nil) 
         {
             // handle the reporting error
             NSLog(@"An error occured reporting the score");
         }
         else 
         {
             NSLog(@"The score was reported successfully");
         }
     }];

Anyone has any experience with GameKit GKErrorDomain Code 3? I receive the error message when I try to upload a score to a leaderboard in the Sandbox. The iOS reference library just says that Indicates that an error occurred when communicating with Game Centre The Here is the full error message:

Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x75e4eb0 {NSUnderlyingError=0x7531e00 "The operation couldn’t be completed. status = 5053", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server

The environment:

  • The request is being made from the 4.1 Simulator
  • GameKit has authenticated the local player who has logged into the Sandbox
  • The leaderboard with the name "Standard" has been created on iTunes connect
  • I can browse the web in the simulator

Here is the code I use to upload the score

    GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"Standard"] autorelease];
    scoreReporter.value = 10;
    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) 
     { 
    if (error != nil) 
         {
             // handle the reporting error
             NSLog(@"An error occured reporting the score");
         }
         else 
         {
             NSLog(@"The score was reported successfully");
         }
     }];

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

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

发布评论

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

评论(2

长不大的小祸害 2024-10-04 09:25:49

GKDomainError Code 3 的原因之一(也是影响我的原因)是初始化 GKScore 时 initWithCategory 消息中指定的排行榜类别 ID 指定不正确。

One reason (which is the reason that was affecting me) for GKDomainError Code 3 is if the Leaderboard Category Id specified in the initWithCategory message when initializing GKScore is incorrectly specified.

如梦初醒的夏天 2024-10-04 09:25:49

如果打印出错误,就更容易追踪。
ETC:

NSLog(@"An error occured reporting the score: %@", error);

It's easier to track down if you print out the error.
Etc:

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