4

我正在为 iPad 和 iPhone 开发一个具有 Game Center 功能的应用程序。游戏从 iPad 2 IOS 6 正确发送一个参与者转弯,但是当我尝试从 iPhone 4 IOS 5 将转弯发送给另一个参与者时,出现以下错误:

<GKTurnBasedParticipant 3d8e50 - id:(null) status:Matching outcome:None lastTurn:(null)>
2013-03-14 23:56:22.030 [453:707] ERROR::::::Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x7a81170 {NSUnderlyingError=0x3f4220 "The operation couldn’t be completed. status = 5008, missing required key: turns", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server.}
2013-03-14 23:56:22.031 [453:707] Oops, there was a problem.  Try that again.

我正在使用以下在 IOS 6 上完美运行的方法:

[currentMatch endTurnWithNextParticipant:nextParticipant
                                       matchData:data completionHandler:^(NSError *error) {
                                           if (error) {
                                               NSLog(@"%@", error);
                                               NSLog(
                                               @"Oops, there was a problem.  Try that again.");
                                           } else {
                                               NSLog(@"Your turn is over.");

                                           }
                                       }];

错误号 3 是 GKErrorCommunicationsFailure,但我不明白这是怎么回事!

当应用程序从游戏中心启动时我正确登录

4

1 回答 1

0

当您在模拟器而不是设备上工作时总是会出现此错误,但有时它会在设备上弹出,因为推送通知失败,请检查您的设备是否正在接收推送通知。

更新

我最近发现 Game Center 不会向没有插入 SIM 卡的设备发送推送通知

于 2013-03-15T08:01:36.750 回答