Firebase - 在重新提交的提交时返回错误请求错误

时间:2016-10-26 22:06:34

标签: android firebase firebase-authentication

我在我的Android应用程序上遇到此异常,但它有点奇怪,因为我已经返回到曾经工作的git提交但现在我仍然收到此错误,相同的代码之前有效的工作并不起作用(我没有改变任何关键或类似的东西)

private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
    Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());

    AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
    mAuth.signInWithCredential(credential)
        .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
            @Override
            public void onComplete(@NonNull Task<AuthResult> task) {
            Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());

            // If sign in fails, display a message to the user. If sign in succeeds
            // the auth state listener will be notified and logic to handle the
            // signed in user can be handled in the listener.
            if (task.isSuccessful()) {
                Log.w(TAG, "signInWithCredential", task.getException());
                Toast.makeText(MainActivity.this, R.string.auth_success,
                        Toast.LENGTH_SHORT).show();
                Intent mapIntent = new Intent(MainActivity.this, MapsActivity.class);
                MainActivity.this.startActivity(mapIntent);
            }else{
                Log.w(TAG, "signInWithCredential", task.getException());
                Toast.makeText(MainActivity.this, R.string.auth_fail,
                        Toast.LENGTH_SHORT).show();
            }
            }
        });
    }

0 个答案:

没有答案