我创建了一个以编程方式使用实时多人游戏的游戏。它最初是针对 IOS 8 设备的。最近移植到IOS 9后,Game Center引起了很多问题。我无法解决的主要问题是在多人游戏中邀请朋友(用于测试)。
从 IOS 8 到 IOS 8。自动匹配工作和好友邀请工作但是从 IOS 9 到 IOS 9。自动匹配工作和好友邀请不再工作。
如果你们中的任何人设法使游戏中心邀请在 IOS 9 上工作。请引导我走向正确的道路。
我目前所知道的:
- 这是一个游戏中心问题,因为我已经从头开始在不同的应用程序上测试了这个问题。这导致了完全相同的问题
- 我正在使用在 iTunes 连接 Testflight 上注册为内部测试人员的帐户
- IOS 9 已将沙盒与生产合并
- 当我发送邀请时,它不会在其他设备上收到(仅限 iOS 9)
- 两个设备都打开了通知,并为应用程序启用了推送通知
- 重启设备没有解决任何问题。我已经测试了 IOS 9.0.0 和 9.0.1
- 我知道 9.0.2 存在我想暂时避免的游戏中心加载问题
更新 - 2015 年 9 月 10 日 在他们为 IOS 8 关闭沙箱之后。自动匹配已开始在 IOS8 和 IOS9 之间工作。但朋友似乎仍然是个问题。这位朋友也停止在 IOS 8 上为我工作。
Game Center 回调似乎在不同的线程上运行,并导致 80% 的机会在连接时崩溃。解决方案是在主线程上运行代码并解决。但是线程问题并没有解决朋友位。
在尝试与好友请求开始匹配后,它会抛出如下错误:
Error Domain=GKErrorDomain
Code=3
"The requested operation could not be completed due to an error communicating with the server."
UserInfo={
GKServerStatusCode=5096,
NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server.,
NSUnderlyingError=0x136e23230 {
Error Domain=GKServerErrorDomain
Code=5096
"Peer device (type: iPad) does not support a game compatible with: unknown:com.xxx.xxx:x:x.x"
UserInfo={
GKServerStatusCode=5096,
NSLocalizedFailureReason=Peer device (type: iPad) does not support a game compatible with:
unknown:com.xxx.xxx:1:x.x
}
}
}