Google Play Games – Using the users tokenID

Updated on August 7, 2017 in [A] Other Answers
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
5 on August 6, 2017

Hello again, 

I am implementing my own cloud save system, and I am curious if every user who downloads the game will have a play games account or not. My plan is to use the local google play games user tokenID [ ((PlayGamesLocalUser)Social.localUser).GetIdToken() ] as a mySQL primary key. Connecting to it files, and other data parameters. However, all this fails if a user does not have a play games account. 

So I guess the basic form of the question is:  Does every user who downloads a game from the google play store have a “Google Play Games” account?

May seem like an obvious one, but my entire system depends on it (and it isn’t clear if its a default for the user or not).




  • Liked by
4 on August 6, 2017

I don’t think everyone who downloads it has a Google Play Games account. You need to have to login in Google Play but I think at some point I had to make a Google Play Games account because some game requested it but I’m not sure.

on August 6, 2017

Hey Leon, thanks for your answer, I appreciate your dedication to the forums!
I am having some trouble finding the best way to store a global unique identifier for the user of my game. The unique device identifier is not good enough considering my implementation. I need an id that is unique to the Google Play account (or system google account), to guarantee I am saving user data globally, and not fixed to a device. 

Do you know the best method of getting the Google Play ID, a users email, or another similar unique user identifier, without asking for input?

on August 6, 2017

I am not so sure. I never looked into Google Play services and such.

on August 7, 2017

Never worked with it, but I’m guessing if a user doesn’t have a Google Play Games account you can’t get those unique identifiers. So the only workaround would probably be to force the user to create a Google Play Games account.

on August 7, 2017

I have ended up going with a multiple ID solution.

If a user does not have a google play account, I am using the SystemInfo.deviceUniqueIdentifier; – and limiting the cloud saves to that device. If they uninstall, and reinstall on the same device, they get the data back.

if the user has the google play games account, the data is static across all devices that are signed in to that account.

Additionally, if they initially ignore the google play games request, but then later accept it (I have it prompt on every re-launch), the table gets updated, and the query is applied to the google play id. (I still use the device id as a fall back).

There is very little documentation on how to create your own cloud save/sync system it…  

Happy I have a working solution 🙂 !
Let me know if anyone wants to see how its done!



Show more replies
  • Liked by