5

I have been looking all over the internet, but can't find my answer.

Is there a way to show the user that they are signed in to the GPGS. The first time you sign in you'll get a notification, what will say "Welcome < name >" But when you open the app the next time nothing is shown.

Is there a way to show a Welcome Back notification?
For iOS it is possible: noted just above Step 9: https://developers.google.com/games/services/ios/quickstart?hl=en#step_9_add_a_sign-out_button

Any ideas?

Dytanoth
  • 107
  • 3
  • 11

1 Answers1

6

If you want the official Welcome Back Notification (the one that shows when a user is authenticated for the first time, or after having been signed out... not just disconnected), there are a few approaches that I use. (this is based on using the GameHelper Class as supplied by Google)

1) When a user quits the game by actually using a control that tells me they have left because they wanted to quit (i.e. not because of a phone call interrupt, or user hits the home button) I have had my apps just sign out of Play Services. This causes the user to have to sign in the next time around (which you can either do for them programmatically, or use the Google Sign in button), which causes the "Welcome Back" to flash. (make sure you use a way to track that they were logged in, as I believe Google wants users to use a button to sign in, if they signed out on their own volition)

2) I have forced the current sign in session to logout upon app startup, which means the same thing, user has to login (whether by app design or Google Button)

3) On app startup, wait for the onSignInSucceeded (which is triggered, but no auto Welcome Back) and show your own "You are Still Signed In" Toast message.

The part you mention above for iOS:

If you run your application again, you should now see a "Welcome back!" notification when you start the game. This is being powered by the GPGManager. At this point, your application and Game services are authorized and ready to go! You're now ready to earn achievements, load save games from the cloud, display social leaderboards, and so on.

Is actually implemented the same way for us... if your user hasn't been connected for a while, and their session has expired... the Welcome Back popup will be displayed when GameHelper re-initiates the connection (Something like 24 hours... I haven't done enough tests to find out exactly when Google tosses the current session credentials)

recnac
  • 3,744
  • 6
  • 24
  • 46
user2346305
  • 1,912
  • 14
  • 21
  • 1
    I think this is not the actual solution. I want to show welcome back popup automatically after auto-signIn process without showing account selection popup to user again. "Beach Buggy Blitz" game is doing this somehow. I have tried some methods like reconnect user etc. but couldn't work. Is there any way to do this? – Fuat Coşkun Feb 03 '14 at 09:43
  • Not sure what you mean, at least the Android side of the house. I just tried Buggy Blitz, and the behavior is just as I mention at the end. When I quit using the back button. The game re-loads and no "welcome back" is shown. If I force shutdown the game using Task Manager, same thing. And if I just use the home button, it loads up as a background process brought back up from onPause. (I haven't waited the few hours that I know will work... but again, I know of no documentation that will allow us to clear or set some flag to get that to occur on its own... only if you follow 1 2 or 3. – user2346305 Feb 03 '14 at 13:18
  • I always see welcome popup when I performed the following scenario simply: - Close the game using back button - Start again by touching the icon of the game. Didn't you see welcome popup on splach screen? – Fuat Coşkun Feb 03 '14 at 14:07
  • I did not. (followed as per your direction) So, as that's the case, even if it occurs on your device (which it sounds like it is for you), it does not occur on mine (S2 running JB), which would mean, the behavior is Not predictable from device to device. – user2346305 Feb 03 '14 at 14:28
  • I guess the root cause is not the device difference. It is probabely related to Google Play Game Services version on your device. Can you please check your "Google Play Services" application version. I have 4.1.32(978161-36) on my device S3 – Fuat Coşkun Feb 03 '14 at 14:56
  • 4.1.32(978161-34) Did get the popup when I first tried this morning (as I said, after a few hours) but did not when I tried the back button, press icon to restart. – user2346305 Feb 04 '14 at 02:37
  • The problem with (3) is that you have no way of knowing whether the auto Welcome was shown or not, so in some instances you will get the auto Welcome plus your bespoke "You are stilled signed in" Toast. – William Nov 29 '14 at 23:52
  • Note that with GooglePlayServices-8.4.0 you will also get an account chooser being shown if you sign out each time. – William Feb 23 '16 at 13:38