Open Hamdiovish opened 3 years ago
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:
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.
I found that this may be the cause?: https://github.com/cgisca/PGSGP/issues/58
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.
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":"lorem@gmail.com","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