how to get googleTokenID and googleAccessToken in Firebase Authentication on Unity

Viewed 2075

On the official documentation of Firebase Authentication, the guide is only available on how you can get the googleAccessToken on native Android & iOS. No solution is available for Unity on their official guide.

Official Documentation showing the issue

The closest solution I have found is to use the Google Play Services plugin for Unity to get the access token, which is not a good solution for the cross-platform as the following plugin is deprecated on the iOS platform. So yah, your code will not work on iOS.

Also, I believe it's an expensive solution to add a plugin for a "googleIdToken".

2 Answers

This process is complicated and Firebase documentation is not helping.

To address this issue Google recently released Google Sign-In plugin for Unity.

You can find detailed instructions on the read me file.

https://github.com/googlesamples/google-signin-unity

Related