iOS 游戏中心邀请在 SANDBOX 中根本不起作用
我正在尝试开发一款多人游戏应用程序我正在使用 GKMatchmaker 来实现这一点。 不幸的是,它的 .inviteHandler
从未被触发,它只是在游戏中心邀请对话中显示“失败”。不过,该应用程序可与自动匹配配合使用。
我做了一些测试&确保
- 登录了 2 个独立的沙盒游戏中心帐户。
- 测试应用程序在 2 台设备上运行(1 台 iPhone 4S 和 1 台 iPad 2),
但它们仍然无法连接。
我尝试启动DOODLE JUMP(一款现有的 iOS 游戏)并使用沙盒帐户进行多人游戏……它们也不起作用。然后我用我的真实非沙盒帐户登录游戏中心和游戏中心。 THERE Doodlejump 正在运行,并且已成功收到邀请。
您有什么想法吗,我如何让我的沙盒帐户正常工作?收到我的游戏中心邀请吗?
I´m trying to develop a multiplayer App & I´m using GKMatchmaker
for that.
Unfortunately its .inviteHandler
is never fired, it just says "failed" in the game center invite dialogue. The app works with AUTO-MATCH though.
I did some testing & made sure that
- 2 seperate sandbox gamecenter accounts are logged in.
- the test app runs on 2 devices (1 iPhone 4S & 1 iPad 2)
They still don´t connect.
I tried to start DOODLE JUMP (an existing iOS Game) und use the sandbox accounts for multiplay... they did not work either. Then i logged in with my REAL NON SANDBOX accounts to game center & THERE Doodlejump was working and the invitation was received successfully.
Do you have any ideas, how I could make my sandbox account work & receive my game center invitations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
希望这对某人仍然有用......
在这种情况下,请检查两件事:
Hope this still would be useful for someone...
Check two things in such situation:
正如 Apple GameKit 编程指南中所述,签名的发行版构建应用程序将使用实时 GC 环境,而其他所有内容都将使用沙箱。除非您拥有 Doodle Jump 源代码并构建调试版本以在您的设备上运行,否则它将无法在沙盒模式下正常工作。
此外,您还应该确保在对用户进行身份验证后尽快调用 informHandler 方法。
As stated in the Apple GameKit Programming Guide, a signed distribution build app will use the live GC environment, while everything else will use the sandbox. Unless you have the Doodle Jump source and build a debug version to run on your devices it will not work in sandbox mode properly.
Also you should make sure you are calling your inviteHandler method as soon after you authenticated a user as possible.
如果上述方法不起作用,请尝试重新启动您的设备。我创建了两个测试帐户,并使用各自的帐户登录到两个不同的设备。尽管自动化运行良好,但我无法收到工作邀请。重新启动设备以某种方式“注册”它们以从游戏中心获取推送通知,并且邀请突然开始起作用。
If the above don't work, try restarting your devices. I created two test accounts and logged into two different devices with each respective account. I couldn't get invitations to work, though automatching was working fine. Restarting the devices somehow 'registered' them to get push notifications from Game Center, and invitations suddenly started working.