How to Google sign in firebase authentication in Unity?

I want to make Sign in inside my mobile game using Google Account and all firebase doc dosn’t help !

what is mean googleIdToken and googleAccessToken when I used the data in .json file in firebase didn’t help !

If any of you are facing any issues with the integration, please check the following (tried on MacOS):

  • In code replace GoogleSignIn.DefaultInstance.SignIn().ContinueWith(OnAuthenticationFinished); with GoogleSignIn.DefaultInstance.SignIn().ContinueWithOnMainThread(OnAuthenticationFinished);
  • If getting “Cannot convert google-services.json to XML” error, check python installation on your system. If on Mac, run the following on terminal to fix

xcode-select --install

  • Disable Minify for both Release/Debug (Build Settings > Android)
  • In “Assets/Plugins/Android/settingsTemplate.gradle” file, ensure that the maven path for Google Signin SDK is exactly

“/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository”

  • One last irrelevant but helpful thing, while you’re making non release builds, use MONO instead of IL2CPP. Your builds will be created faster. Though ensure that you switch back to IL2CPP for release builds, otherwise players will get a “Not Compatible with Latest Android” warning on first launch.

Hope this helps someone.

disculpa, ¿lograste hayar la respuesta? tambien estoy interesado en hacer un login para un juego y hacer usando el sistema de google, pero estoy peor que tu, no tengo ni idea

One way of doing this is to use the OAuth2.0 from Google Cloud to sign in the user using Google and then pass that token to Firebase auth. You can use free open-source plugin to do it.

Here is the step-by-step process: