我是一名新手 iOS 开发人员,目前正在开发一款棋盘游戏。我想集成 UIGameKit,但我遇到了麻烦。好像总是无法自动匹配,邀请好友...
我确实检查了构建包 ID,并且我已经在 iTunes Connect 中启用了 gc,但仍然没有运气。当我在设备或模拟器上单击“立即播放”时,在超时之前什么都不会发生。当我单击“邀请朋友”时,它也会失败并显示以下错误消息:
ERROR: {
GKServerStatusCode = 5008;
NSLocalizedDescription = "The requested operation could not be completed due to an error communicating with the server.";
NSUnderlyingError = "Error Domain=GKServerErrorDomain Code=5008 \"The operation couldn\U2019t be completed. status = 5008, missing required key: self-push-token\" UserInfo=0xae53360 {GKServerStatusCode=5008, NSLocalizedFailureReason=status = 5008, missing required key: self-push-token}";
我不明白我缺少什么游戏套件所需的密钥?错误消息要求的自推送令牌是什么?
(编者注:不要认为下面的代码是相关的,无论如何都会离开这里)
GKMatchRequest* request = [[GKMatchRequest alloc] init];
request.minPlayers = 2;
request.maxPlayers = 2;
GKMatchmakerViewController* hostVC = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
if (hostVC != nil)
{
hostVC.matchmakerDelegate = self;
[self presentViewController:hostVC];
}
有什么帮助吗?我试图找到一些好的示例来构建一个简单的游戏套件自动匹配应用程序,但没有任何运气,有人对我有建议吗?