FirebaseAuth:发送失败结果时出现RemoteException

时间:2019-09-11 02:26:06

标签: android firebase-authentication

我在使用Firebase身份验证时出现问题

 private fun startPhoneNumberVerification() {
        PhoneAuthProvider.getInstance().verifyPhoneNumber(
            phoneNumber,
            VERIFY_PHONE_NUMBER_TIME_OUT_IN_SECOND,
            TimeUnit.SECONDS,
            requireActivity(),
            stateChangedCallbacks
        )
    } 

stateChangedCallbacks

stateChangedCallbacks = object : PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
            override fun onVerificationCompleted(credential: PhoneAuthCredential) {
                // todo check if user is exist then block this flow
            }

            override fun onVerificationFailed(e: FirebaseException) {    
                if (e is FirebaseAuthInvalidCredentialsException) {
                    // todo handle case invalid credential
                } else if (e is FirebaseTooManyRequestsException) {
                    // todo handle case fire base too many requests
                }
            }

            override fun onCodeSent(
                verificationId: String,
                token: PhoneAuthProvider.ForceResendingToken
            ) {
                goToVerifyCode(verificationId)
            }
        }

问题是,有时尽管调用了onCodeSent,但我没有收到otp-sms,有时会发生错误

  

E / FirebaseAuth:[VerifyPhoneNumberOperation] RemoteException when   发送失败结果。       android.os.DeadObjectException           在android.os.BinderProxy.transactNative(本地方法)           在android.os.BinderProxy.transact(Binder.java:503)           在crb.c(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):1)           在bmlm.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):8)           在bmli.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):7)           在bmik.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):3)           在bmif.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):2)           在bmim.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):5)           在bmkm.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):7)           在bmio.a(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):158)           在bmif.handleMessage(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):37)           在rri.run(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):6)           在rrt.b(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):32)           在rrt.run(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275):21)           在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)           在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:588)           在rxx.run(:com.google.android.gms @ 16089022 @ 16.0.89(040700-239467275))           在java.lang.Thread.run(Thread.java:818)

有人以前遇到过这个问题吗?有人对我的问题有建议吗?任何回应将不胜感激。

0 个答案:

没有答案