Google Play Services - Custom Notification / Greeting

I look all over the Internet but cannot find the answer.

Is there a way to show the user that they are logged in to GPGS. The first time you log in, you’ll get a notification saying β€œWelcome <name”, but when you open the application, next time nothing is displayed. Is there a way to show a greeting notification?
For iOS, you can: check a little higher Step 9: https://developers.google.com/games/services/ios/quickstart?hl=en#step_9_add_a_sign-out_button

Any ideas?

+5
java android google-play-services andengine
source share
1 answer

If you want a formal greeting return notification (one that shows when the user is first authenticated, or after he has signed up ... not just disconnected), there are several approaches that I use. (this is based on using the GameHelper class provided by Google)

1) When a user leaves the game, actually using a control that tells me that they left because they wanted to exit (that is, not because the phone was interrupted, or the user clicks the home button), I have were my applications just exit Play Services. This forces the user to register next time (which you can do for them programmatically or use the "Goggle Icon" button), which causes the "Welcome Back" to flash. (make sure you use the way to track that they are logged in, because I believe that Google wants users to use the login button if they subscribe at will)

2) I made the current logon in the session log out when the application starts, which means the same thing, the user needs to log in (whether by application design or Google button).

3) When the application starts, wait for onSignInSucceeded to appear (which starts, but there is no automatic greeting) and show your own message "You are still signed up."

Part mentioned above for iOS:

If you run your application again, you should see "Welcome!". notification when the game starts. This is powered by GPGManager. At the moment, your application and game services are authorized and ready to go! Now you are ready to earn achievements, download games with clouds, display social tables, etc.

It’s actually implemented the same way for us ... if your user has not been connected for some time and expired ... the Back Back pop-up will be displayed when the GameHelper initiates the connection again (for example, 24 hours ... I have not done enough tests to find out when Google is viewing the current session credentials)

+4
source share

All Articles