iPhone游戏套件:与沙盒通信-GKErrorDomain代码3
有人有过GameKit GKErrorDomain代码3的使用经验吗?当我尝试将分数上传到沙箱中的排行榜时,我收到错误消息。iOS参考库只是说iPhone游戏套件:与沙盒通信-GKErrorDomain代码3,iphone,app-store-connect,gamekit,Iphone,App Store Connect,Gamekit,有人有过GameKit GKErrorDomain代码3的使用经验吗?当我尝试将分数上传到沙箱中的排行榜时,我收到错误消息。iOS参考库只是说表示与游戏中心通信时发生错误,以下是完整的错误消息: Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x75e4eb0 {NS
表示与游戏中心通信时发生错误
,以下是完整的错误消息:
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");
}
}];
GKDomainError Code 3的一个原因(影响我的原因)是初始化GKScore时在initWithCategory消息中指定的排行榜类别Id未正确指定。如果打印出错误,则更容易跟踪。 等等:
这几乎是苹果文档的分数。我已经成功地使用了它。我发现,与GameCenter通信时发生的错误往往是由服务器端的问题引起的。突然,事情停止了工作,几个小时后,一切又恢复正常。我意识到initWithCategory参数应该采用完全限定的名称,例如com.companyName.productName.Leadboard或com.companyName.Leadboard。。。但仍然是gkerrodomain Code=3
NSLog(@"An error occured reporting the score: %@", error);