Android Google Plus sign in issue. handleSignInResult returns False

前端 未结 8 1063
日久生厌
日久生厌 2021-01-02 04:07

I\'ve been facing some issues while integrating Google+ Signin functionality. So far, i\'ve integrated all the necessary G+ Sign in API modules and codes which works good, g

8条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 04:39

    Are you using Plus.API or Auth.GOOGLE_SIGN_IN_API? The latter is the latest revamped one. Check it out here: https://developers.google.com/identity/sign-in/android/sign-in


    If you are using Auth.GOOGLE_SIGN_IN_API:

    In onActivityResult, use code similar to below and you can get a status code, which is defined by GoogleSignInStatusCodes: https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    
        // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
        if (requestCode == RC_SIGN_IN) {
            GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
            int statusCode = result.getStatus().getStatusCode();
        }
    }
    

    The most common issue is missing the right OAuth2 client registration. (Unfortunately, for now, the status code is INTERNAL_ERROR 8, which is not helpful. ) E.g. Take a look at this thread: Occured an INTERNAL_ERROR when requestEmail from GoogleSignInOptions Android

提交回复
热议问题