Friday 15 June 2012

android - OnInvitationReceivedListener does not fire reliably (if at all) - Google Play Game Services Button Clicker -


In an attempt to exclude the button clicker demo of Play Game Services, I have no luck (okay, 1 time Out of hundreds), the author urging to get the inspiration.

I have seen here and here, and have made sure to use the test accounts which are part of my internal circles.

I tested:

I tried to send the invitation before logging in to another user (I have not received the game but connect (bundle hit connection) is a non-faucet Values).

I have tried to send the invitation after both the accounts were logged in. (1 time received via notification and to click on the top to say, this is it, and see) waited, and waited, and waited for anything fire (nothing in the log ever Is showing happening, and because there is no return value to send invitations, there is nothing about inviting)

I can go to the sender waiting room (see the invitation) Are and The council is present there. I can also use the Games Client LoadEviting Method, and get the invitation. If I log out of one of the users, then I receive occasional (sometimes) invitation notifications in the status bar, when I invite another test account (after some time the length is slightly different Is, half an hour later), so I know the invitation is being sent, and can be blocked by some in the form of documentation.

Public Zero Register Invention Listener (On-Invitation Relaylist Listener Listener)

Prevent incoming invitations for a listener register Currently the sign-in user if a listener If registered with the law, then the incoming invitations will not receive a status bar notification, unless this client remains.

Note that only one listener can be active at one time. While calling this method another listener was previously registered, with the new audience will be replaced by the original listener. Parameters consider the listener as a listener, which is called upon when a new invitation is received. The listener is called on the main thread.

So my test shows that the first part is working (Heh, only got the status bar notification of an invitation, which was sent 29 minutes before typing it ..)

I honestly do not know about the other part, as I said, I can never bring the listener to the fire!

So, the reaction about the invitation? If not, is there any other necessary step to set the listener on fire?

I had the same issue.

I do not use the BaseGameActivity class. According to

, the proper way to register the listener is to connect to the callback

I followed the instructions above, but connect to ) was never called, so my invitation list was never registered.

My problem was that I was not explicitly requesting more clients, and I was not registering the proper callback at all. Applying connection callbacks and overwriting the onconnect () method is not enough - GameHelper does not register for you callback.

  The main activity of the public category implements Android applications ..., connection callbacks, on-invention rescue listener {... @Cleate public on @reate (bundle savedinstensestate) { ... gameHelper = new GameHelper (this); GameHelper.setup (this, GameHelper.CLIENT_GAMES | GameHelper.CLIENT_PLUS); GameHelper.getPlusClient () registerConnectionCallbacks (this). ...} Override public null at @connected (bundle connection hunt) {gameHelper.getGamesClient (). Register Invitation Lastner (this); ...}   

After entering the appropriate two callbacks, I now get the invitation notifications during gameplay.

No comments:

Post a Comment