Skip to content Skip to sidebar Skip to footer

How To Immediately Get Id Token From Google Play Services Unity Plugin

I'm using https://github.com/playgameservices/play-games-plugin-for-unity plugin to sign in user with his google account , and then i want to get Id Token and send it to my server

Solution 1:

They changed the plugin in new version and now

PlayGamesPlatform.Instance.GetIdToken(Callback)

has a callback function.

Solution 2:

If you want to identify a user on your own web service it would be better to use the server auth code. Send this to your server and get the user identity via jwt from google.

GooglePlayGames.OurUtils.PlayGamesHelperObject.RunOnGameThread(() => {

                    PlayGamesPlatform.Instance.GetServerAuthCode((CommonStatusCodes status, string code) =>
                    {                            
                        Debug.Log("Status: " + status.ToString());
                        Debug.Log("Code: " + code);

                    });

                });

Post a Comment for "How To Immediately Get Id Token From Google Play Services Unity Plugin"