Rai*_*rze 5 objective-c ios game-center ios9
我无法让GameCenter邀请朋友上班.匹配器制造商视图控制器很快显示被邀请的玩家以及其下的一个小文本"失败".也许我选择了错误的时间来学习GameCenter,因为很多人都报告了iOS9的困难.但也许某处有解决方案.
基本:
viewDidLoad播放器中,通过分配块来启动认证[GKLocalPlayer localPlayer].authenticateHandler.在块中,显示传入的视图控制器(如果有的话).这有效.GKGameCenterControllerDelegate并且它工作,接收到"didFinish"调用并且我在那里关闭GameCenter视图控制器.[[GKLocalPlayer localPlayer] registerListener:...];.所有GKLocalPlayerListener方法的方法存根都通过日志调用实现.GKMatchRequest和GKMatchmakerViewController,将我的视图控制器设置为匹配器委托并显示匹配器视图控制器.同样,所有委托方法都使用日志调用实现.问题:
其他资源:
GameKit日志:
我打开iPhone上的设置中的GameCenter日志记录并导出日志.引起我注意的第一件事是"没有注册同行(...)":
<NSHTTPURLResponse: 0x167a2cc0> { URL: https://service.gc.apple.com/WebObjects/GKInvitationService.woa/wa/initiate } { status code: 200, headers { ... }
...
status: (200) no error
header: <CFBasicHash 0x165e6480 [0x3b6633e8]>{type = immutable dict, count = 10,
entries =>
...
body: <CFBasicHash 0x17811ad0 [0x3b6633e8]>{type = mutable dict, count = 4,
entries =>
...
3 : <CFString 0x38bc0f78 [0x3b6633e8]>{contents = "message"} = <CFString 0x165c0610 [0x3b6633e8]>
{contents = "No registration for peer (G:<stripped>/?/?)"}
...
9 : <CFString 0x38bb53d8 [0x3b6633e8]>{contents = "status"} = <CFNumber 0x165cacc0 [0x3b6633e8]>{value = +5030, type = kCFNumberSInt64Type}
}
Run Code Online (Sandbox Code Playgroud)
编辑1:
忘记日志中的下一个条目:(手动包装)
[(gamed:123:NO):Error] invite failed with error: Error Domain=GKErrorDomain Code=3
"The requested operation could not be completed due to an error communicating with the server."
UserInfo={GKServerStatusCode=5030, NSUnderlyingError=0x167528a0 {Error Domain=GKServerErrorDomain
Code=5030 "No registration for peer (<stripped>)"
UserInfo={GKServerStatusCode=5030, NSLocalizedFailureReason=No registration for peer (<stripped>)}},
NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server.}
Run Code Online (Sandbox Code Playgroud)
编辑2:
我在两个设备上测试了两个非沙盒帐户,这两个设备连接到运行Xcode 7.1/iOS 9.1上的两个设备的两个不同的mac.无论哪个方向,我仍然在游戏中心匹配制造商屏幕上收到"失败"消息.