【发布时间】:2010-10-13 06:39:57
【问题描述】:
有人对 GameKit GKErrorDomain Code 3 有任何经验吗?当我尝试将分数上传到沙盒中的排行榜时收到错误消息。 iOS 参考库只是说Indicates that an error occurred when communicating with Game Centre 这里是完整的错误信息:
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 已对登录沙盒的本地玩家进行身份验证
- 已在 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");
}
}];
【问题讨论】:
-
这几乎是来自 Apple 文档的分数。我已经成功地使用了它。我发现,与 GameCenter 通信时出现的错误通常是由服务器端的问题引起的。突然事情停止了,几个小时后,一切又好了。
-
我意识到 initWithCategory 参数应该采用完全限定名称,例如 com.companyName.productName.leaderboard 或 com.companyName.leaderboard ...但仍然是 GKErrorDomain Code=3
标签: iphone app-store-connect gamekit