How to resend SMS verification in Firebase Phone Authentication Android?

前端 未结 3 915
梦如初夏
梦如初夏 2021-01-07 19:41

According to Firebase documentation (https://firebase.google.com/docs/auth/android/phone-auth#send-a-verification-code-to-the-users-phone), there is callback fo

3条回答
  •  再見小時候
    2021-01-07 20:18

    Source: Github

    This is the method used to resend SMS Verifications.

    private void resendVerificationCode(String phoneNumber,
                                        PhoneAuthProvider.ForceResendingToken token) {
        PhoneAuthProvider.getInstance().verifyPhoneNumber(
                phoneNumber,        // Phone number to verify
                60,                 // Timeout duration
                TimeUnit.SECONDS,   // Unit of timeout
                this,               // Activity (for callback binding)
                mCallbacks,         // OnVerificationStateChangedCallbacks
                token);             // ForceResendingToken from callbacks
    }
    

提交回复
热议问题