每次我使用firebase登录时都会重新验证电话号码

时间:2018-05-01 14:02:32

标签: android firebase

我想每次登录firebase时重新验证电话号码

PhoneAuthProvider.getInstance().verifyPhoneNumber(
                   phone,        // Phone number to verify
                    60,                 // Timeout duration
                    TimeUnit.SECONDS,   // Unit of timeout
                    Main2Activity.this,               // Activity (for callback binding)
                    new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
                        @Override
                        public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
                            signInWithPhoneAuthCredential(phoneAuthCredential);
                        }

                        @Override
                        public void onVerificationFailed(FirebaseException e) {

                        }
                        @Override
                        public void onCodeSent(String verificationId,
                                               PhoneAuthProvider.ForceResendingToken token) {
                            mVerificationId = verificationId;
                            mResendToken = token;
                        }
                   }
                    );

此代码仅在登录后无需验证

0 个答案:

没有答案