Firebase没有发送OTP

时间:2020-08-26 09:01:17

标签: firebase firebase-authentication

我正在开发一个使用使用电话号码进行身份验证功能的应用程序,我将此功能集成到了应用程序中,然后当我运行此应用程序时,Firebase不会将otp发送到我的手机号码。

private void sendVerificationCode(){
    String phone=editPhone.getText().toString();
    PhoneAuthProvider.getInstance().verifyPhoneNumber(
        phone,       
        60,          
        TimeUnit.SECONDS, 
        this,             
        mCallbacks);      
}
PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks=new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
    @Override
    public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) {

    }

    @Override
    public void onVerificationFailed(@NonNull FirebaseException e) {

    }

    @Override
    public void onCodeSent(@NonNull String s, @NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
        super.onCodeSent(s, forceResendingToken);
        codeSent=s;
    }
};

0 个答案:

没有答案