问题
I’m playing around with Google Play Game Services and multiplayer support. If I invite a player with this service, is it possible to send a notification to the receiver automatically? When I use the demo project nothing like this occurs. The documentation however says:
If the signed-in player accepts an invitation from the notification area on the Android status bar, your app should accept the invitation and go directly to the game screen (skipping the main menu).
This doesn’t explicit says that notifications are supported, but it gives my some hope at least :-). According to this question: Google play game services invitations get lost notifications seems to be supported, but I have never received any.
回答1:
notifications are supported and will be sent to the receiving player... if the players are not in each other's circles sometimes the notification does not get displayed, depending on the receiver's settings. maybe that is why you haven't received any?
回答2:
Ok, I finally solved much thanks to @smiller.
First of all I had my test account circled just as Following. This is not enough! Some other circle (Friend, Familiy etc) has to be used. If the person is just in the following circle, onRoomCreated is called with status code 6 (STATUS_NETWORK_ERROR_OPERATION_FAILED) on the inviter's application.
A secondary problem I had was that data synchronizing was turned off on my device. Obviously this has to be turn on. Unfortunately the inviter never get some feedback on this, it just waits forever.
来源:https://stackoverflow.com/questions/17149066/send-notification-when-inviting-to-multiplayer-game-game-services