3

I am making a game with Unity, and going to integrate Google play login with PGS V2, I know with PGS V2 I cannot request extra scope (it was mentioned here https://developers.google.com/games/services/common/concepts/sign-in).

I can get auth code and can send it to the server and get an access token (with https://oauth2.googleapis.com/token). But I don't know how to get playerId at the server yet, I can find verify API (https://developers.google.com/games/services/web/api/applications/verify) but I can't get playerId with it yet, I guess that it is because of "https://www.googleapis.com/auth/games" scope requirement.

So I post here to find any way to get playerId, I don't know if there are any other APIs that I can use to get just a playerId. Or I will have to write a new Google Login client plugin because I can't find it yet.

Thank you :)

1 Answers1

1

Now I can use verify API (https://developers.google.com/games/services/web/api/applications/verify) to get playerId after several tries.

So we can use verify API, while there is no https://www.googleapis.com/auth/games scope (have https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/games_lite)

How to use it

GET https://games.googleapis.com/games/v1/applications/{applicationId}/verify

with following headers:

  • Authorization: Bearer {accessToken}

You can get {applicationId} from client ID, it is number before -.

  • Hi did you do this with a php backend or java? if it was php would you mind sharing your code as I am looking to do the exact same but having trouble getting the players id from the auth code sent from unity, Thanks. – Adam Feb 04 '23 at 18:24