简体   繁体   English

Google Play游戏服务邀请函迷失了

[英]Google play game services invitations get lost

I am using the new Google Play Game Services to develop my game on Android and I am now trying to include the invitation system. 我正在使用新的Google Play游戏服务在Android上开发我的游戏,现在我正在尝试添加邀请系统。 Have have 3 Google+ accounts that I use to try the invitations with 2 Android devices and 1 Android emulator. 我有3个Google+帐户可用于试用2个Android设备和1个Android模拟器的邀请。

My problem is that the invitations are not always received when they are sent. 我的问题是发送时并不总是收到邀请。 Sometimes it works fast and perfectly, sometimes it won't work. 有时它可以快速而完美地工作,有时它不会起作用。 Just cancelling the invitation and trying again can change the result. 只需取消邀请并再次尝试即可更改结果。

Here a 3 tests I did just to make it clearer : 这里我做了3次测试,只是为了让它更清晰:

Test 1: Emulator was inviter, Nexus 4 didn't receive and Optimus One received 测试1:模拟器是邀请者,Nexus 4没有收到,Optimus One收到

Test 2: Nexus 4 was inviter, Emulator received and Optimus One received 测试2:Nexus 4是邀请者,Emulator收到,Optimus One收到

Test 3: Optimus One was inviter, Emulator received and Nexus 4 didn't receive 测试3:Optimus One是邀请者,Emulator收到,Nexus 4没有收到

From those results we can see that my Nexus 4 received no invitation, but it worked several times before those tests. 从这些结果我们可以看出我的Nexus 4没有收到任何邀请,但在这些测试之前它已经工作了好几次。

Furthermore, sometimes I receive the invitation notification (on the status bar), but most of the time I don't receive it. 此外,有时我收到邀请通知(在状态栏上),但大部分时间我都没有收到。

Did someone experienced the same abnormalities as I did? 有人经历过和我一样的异常吗?

It may be to do with the accounts you are signed in on. 这可能与您登录的帐户有关。 I've found that I can send invites fine from my dev account to the 'test' account but not the other way around. 我发现我可以从我的开发帐户向“测试”帐户发送邀请,但不是相反。

If you are using a Wi-Fi hotspot (wireless router) for testing and there are other Wi-Fi hotspots in the vicinity, they can interfere with your Wi-Fi signal and block game invitations. 如果您使用Wi-Fi热点(无线路由器)进行测试,附近还有其他Wi-Fi热点,它们可能会干扰您的Wi-Fi信号并阻止游戏邀请。 Although there are 11 channels available on the 2.4 GHz band that most routers use, most wireless routers default to using the same channel (6). 虽然大多数路由器使用的2.4 GHz频段有11个频道可用,但大多数无线路由器默认使用相同的频道(6)。 If you are in this situation, try changing the channel your router uses. 如果您遇到这种情况,请尝试更改路由器使用的频道。

This problem kept me flummoxed for several weeks. 这个问题让我陷入了几个星期的困境。

Some pointers: 一些指示:

  1. Check that all the test accounts have one another in their circles. 检查所有测试帐户是否在他们的圈子中互相拥有。 So, if your test accounts are A, B and C, then A should have B and C in their circles, B should have A and C, and C should have A and B. 所以,如果你的测试账户是A,B和C,那么A应该在他们的圈子中有B和C,B应该有A和C,C应该有A和B.

  2. The time it takes for an invitation to be delivered may vary; 邀请交付所需的时间可能会有所不同; network connectivity is a large factor in that. 网络连接是其中的一个重要因素。 Don't give up too early -- wait up to 1 minute without quitting the handshake process, and the invitation should appear. 不要太早放弃 - 等待最多1分钟而不退出握手过程,并且应该出现邀请。

  3. If the game is unpublished, make sure that all test accounts are listed in the Testing section of the application's settings on Developer Console. 如果游戏未发布,请确保所有测试帐户都列在Developer Console上应用程序设置的“测试”部分中。 If a tester is not listed, they will not get an invitation popup. 如果未列出测试人员,他们将不会收到邀请弹出窗口。 Note: even the developer who created the app on Developer Console must be listed as a tester. 注意:即使是在Developer Console上创建应用程序的开发人员也必须列为测试人员。

If you are using Games.Invitations.registerInvitationListener() your code is expected to handle the invitation and you will not get a standard android notification. 如果您正在使用Games.Invitations.registerInvitationListener()您的代码应该处理邀请,您将无法获得标准的Android通知。 Now, if you are not calling Games.Invitations.unregisterInvitationListener() at the appropriate times, maybe your code is not handling the invitation properly and it is consuming it without your will. 现在,如果你没有在适当的时候调用Games.Invitations.unregisterInvitationListener() ,也许你的代码没有正确处理邀请,而且没有你的意愿就会消耗它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM