I've implemented firebase phone authentication in my app and it's working fine when the user uses the app on the phone which the user receives the OTP on. I'm able to verify the OTP perfectly once I receive the OTP on my phone.
But, I just thought of another use case where a user might be using the app on the tablet and when he/she has to verify their mobile number in order to continue using the app. So they enter their mobile number on the tablet and receive the OTP on their phone. In this case, when they enter the OTP they received on their phone in the tablet, I'm not able to verify the OTP since the onVerificationCompleted() method holding null in place of the value.
Can anyone help handle this case gracefully?
Thank you.
答案 0 :(得分:0)
在这种情况下,您必须使用onCodeSent
和onCodeAutoRetrievalTimeOut
callbacks并要求用户输入代码并初始化PhoneAuthCredential
才能完成登录。 / p>