playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 953 forks source link

What is the unique player ID? #3272

Open icebluehalls opened 7 months ago

icebluehalls commented 7 months ago

For the old GPGS, I got the id_token value after the GPGS login, successfully authenticated to the Google server OAUTH2 and got the sub value.

However, with GPGS V2, when I tried the same, it was impossible to get sub due to lack of scope permission.

The documentation said that the gamePlayerId that exists in https://www.googleapis.com/games/v1/players/me is a unique value for the application, so I tried to use that instead of sub. However, when I created an access_token based on the code returned by GPGS V2 and called it, the gamePlayerId value was excluded, as shown below.

{
"kind": "games#player",
"playerId": "a_3433333333926102",
"displayName": "222222222",
"avatarImageUrl": "~~~",
"bannerUrlPortrait": "~~~",
"bannerUrlLandscape": "~~~",
"profileSettings":{
"kind": "games#profileSettings",
"profileVisible": True,
"friendsListVisibility": "REQUEST_REQUIRED"
},
"experienceInfo":{
"kind": "games#playerExperienceInfo",
"currentExperiencePoints": "0",
"currentLevel":{"kind": "games#playerLevel", "level": 1, "minExperiencePoints": "0", "maxExperiencePoints": "1000"...},
"nextLevel":{"kind": "games#playerLevel", "level": 2, "minExperiencePoints": "1000", "maxExperiencePoints": "2500"...}
},
"title": "Rookie"
}

What value should I use to create a unique user on my server?