Amin_it Amin_it - 3 months ago 62x
Android Question

How to immediately get id token from google play services Unity Plugin

I'm using plugin to sign in user with his google account , and then i want to get Id Token and send it to my server and register an account for this user in my own database.this is my code to get Id token :

PlayGamesPlatform.Instance.Authenticate(success =>
if (success)
Debug.Log("Id Token :");
Debug.LogFormat("{0}", PlayGamesPlatform.Instance.GetIdToken());
Debug.Log("End Of Id Token");

The problem is the first time it prints just empty string , when i call this for the second time (or a moment later) it prints the token. I want to get token immediately or with a callback to make sure that token is recieved .

How to make sure that token is recieved? is there any callback for this?



They changed the plugin in new version and now


has a callback function.