Having implemented the FireBase phone authentication as per the documentation, I get several problems.
On the log, I can confirm that the code has been sent but I haven't received it on my phone:
D/PhoneAuthenticating: onCodeSent:AM5PThBss5tbYdpNW5R9Q7o8zOYeHvd7lnZ1KBlS...
W/PhoneAuthenticating: signInWithCredential:failure com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The sms code has expired. Please re-send the verification code to try again. at com.google.android.gms.internal.nf.zzK(Unknown Source) at com.google.android.gms.internal.mg.zza(Unknown Source) at com.google.android.gms.internal.oa.zzL(Unknown Source) at com.google.android.gms.internal.oc.onFailure(Unknown Source) at com.google.android.gms.internal.nj.onTransact(Unknown Source) at android.os.Binder.execTransact(Binder.java:446)
This exception is thrown:
FirebaseAuthInvalidCredentialsException
code expiry takes more in than 3599 seconds in firebase. The time taken to verify is less than a minute
Don't forget to go in Firebase Project Settings > App check > and Register firebase project in SafetyNet and Play Integrity register with default time token 1 hour and u will remove reCaptcha from phone auth OTP!
Prices are per successful verification. On the Blaze plan, Phone Authentication provides a no-cost tier. The first 10K verifications for both instances (USA, Canada, and India and All other countries) are provided at no cost each month.
Just so that you know there's an auto retrieval section in firebase phone authentication which will read sms and invalidate it in the background. The callback for that auto-retrieval should be used to authenticate your user without him entering the sms manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With