How to access Google Play Games Gamer ID

旧时模样 提交于 2019-12-30 07:45:41

问题


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:

  1. Is there any way to programmatically get the Google Play Game Gamer ID of the local player?
  2. Is there a way to be sure that what I have got is a Gamer ID, and not the old-style google+ identity which carries extra privacy issues?
  3. Am I right in assuming that privacy over the new Gamer IDs is more relaxed and that google and my users will not be concerned about having gamer IDs shared when playing against random opponents on the internet?

回答1:


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:

  1. You can programmatically get the local player's ID, name and avatar as usual using Games.getCurrentPlayerId() or Games.getCurrentPlayer() then using Player.getDisplayName().

  2. 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.

  3. 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.



来源:https://stackoverflow.com/questions/36177641/how-to-access-google-play-games-gamer-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!