PGSGP icon indicating copy to clipboard operation
PGSGP copied to clipboard

Update SignIn result: add token and email

Open Hamdiovish opened this issue 5 years ago • 3 comments

This is actually an updated version of the PR #35. This PR add support to request email, profile and token id within the signin call. The token id can be used for server side logics such auth and getting user details. So the result of "_on_sign_in_success()" callback will be in the fallowing format: {"displayName":"lorem","email":"[email protected]","id":"0123456789","token":"lorem_epsum"}

Note: the requestToken must be created first in the google cloud console as a "OAuth 2.0 Client IDs" of a web application: https://console.cloud.google.com/apis/credentials

Note: this PR isn't a duplication of the "Player Info" section, since the "token id" can be retrieved only at the sign in level.

Regards

Hamdiovish avatar Oct 05 '20 22:10 Hamdiovish

Thanks for the pull request! (I'm not the owner of this repo, just someone grateful for your work)

I have the OAuth Client ID of type "Web application" already created and I've tried using it but having a non-empty requestToken like so:

play_games_services.init(true, false, false, "<my web application client id>")

would result in a perpetually loading pop-up that appears after tapping on an account to sign-in:

20210201_193002

It never managed to get sign in to Google Play Games Services though.

However if I were to leave requestToken empty:

play_games_services.init(true, false, false, "")

it always signs in successfully.

Strangely, before trying out your pull request, if I were to use initWithSavedGames instead of init, the same thing always happened with that perpetual loading.

It might be something I miss when it comes to configuring Google Play Console, but I can't figure it out.

oneseedfruit avatar Feb 02 '21 12:02 oneseedfruit

I found that this may be the cause?: https://github.com/cgisca/PGSGP/issues/58

oneseedfruit avatar Feb 03 '21 04:02 oneseedfruit

Found the fix: https://github.com/cgisca/PGSGP/issues/58#issuecomment-772416915

Caused by deprecated API. :'( This solved the problem of not able to use init with Savved Games.

However using this pull request to get token doesn't work.

oneseedfruit avatar Feb 03 '21 10:02 oneseedfruit