Google Sign-In requestIdToken returns null

后端 未结 3 846
太阳男子
太阳男子 2020-12-08 08:39

I forked this google sample project and ran the android signin.

I set up the options in the google developers console and got a client id, but when running the proje

相关标签:
3条回答
  • 2020-12-08 09:08

    As I have commented and as Google's documentation, you should use "Web application" type Client Id, instead of "Android" type Client Id.

    As the following screenshot:

    0 讨论(0)
  • 2020-12-08 09:14

    Use "default_web_client_id" in GoogleSignInOptions

     GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                    .requestIdToken(getString(R.string.default_web_client_id))
                    .requestEmail()
                    .build();
    

    It works perfectly.

    0 讨论(0)
  • 2020-12-08 09:26

    In my case was just the incompatible version of the libraries... :(

    0 讨论(0)
提交回复
热议问题