Reputation: 6766
Recently google added the concept of a Gamer ID to Google Play Games services which allows a player to setup a gaming identity distinct from their google+ identity. http://officialandroid.blogspot.co.uk/2016/02/embrace-your-inner-gaming-hero-with.html
My use case is that I have an online multiplayer game which uses my own matchmaking server. I don't use Google Play Game's matchmaking because I require skill-based matchmaking capabilities that are not currently available using GPGS.
I'd like to be able to display the player's Google Play Games identity (just the name) if they happen to have signed in. However, I had previously elected not to for privacy reasons as I know that in Quick Matches with GPGS, google elects to conceal your opponent's identities, and I felt I should follow their lead.
Now, I think that part of the reason that gamer IDs have been added is to avoid the need for such caution over privacy. So I have the following questions:
Upvotes: 2
Views: 4155
Reputation: 4572
You can get some more information from http://android-developers.blogspot.com/2016/01/play-games-permissions-are-changing-in.html
Quick answers to your questions:
You can programmatically get the local player's ID, name and avatar as usual using Games.getCurrentPlayerId() or Games.getCurrentPlayer() then using Player.getDisplayName().
You can verify the player's identity on the server side using www.googleapis.com/games/v1/applications/<app_id>/verify/
with a
token obtained as described in the blog post. The updated
permissions are rolling out now, so I'd expect it to be everywhere
very soon.
Yes, the new gamer identity is independent of Google+ for exactly this reason. So you can safely use the gamer identity without risking the privacy of the player.
Upvotes: 4