handleSignInResult返回false

时间:2018-01-01 09:17:43

标签: android google-signin

我有一个旧的android项目(大约3个月我还没碰过它)。现在我正在重建项目,谷歌登录无法正常工作。我意识到了

result.isSuccess() 

返回false和

result.getStatus().getStatusCode()

返回10。

我的代码:

    @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == RC_SIGN_IN) {
        GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        handleSignInResult(result);
    }
}

    private void handleSignInResult(GoogleSignInResult result) {
    if (result.isSuccess()) {
        GoogleSignInAccount acct = result.getSignInAccount();
        assert acct != null;
        googleSigninToken = acct.getIdToken();
        Toast.makeText(this, googleSigninToken, Toast.LENGTH_SHORT).show();
        enteredEmail = acct.getEmail();
        signInGoogle(googleSigninToken);
    }
    else{
        Toast.makeText(this, "no success", Toast.LENGTH_SHORT).show();
    }
}

在我的signInGoogle函数中,我将google登录令牌传递给服务器,其余的不是我关注的问题。

问题出在哪里? 如果这很重要我在gradle中有以下内容:

compile 'com.google.firebase:firebase-auth:11.6.2'
compile 'com.google.android.gms:play-services-auth:11.6.2'

0 个答案:

没有答案