I am experiencing unpredictable behaviour when authenticating users with firebase phone Auth for web, with the javascript modular web api. These are my dependencies:
“@firebase/auth”: “^0.19.11”, “firebase”: “^9.6.8”,
I have tested approximately 20 real phone numbers and some test numbers and for most of the time it works fine. But for some it fails to send the OTP code, without throwing any error message. I have ruled out bugs in the code and cannot really identify a pattern in why it works for most of the numbers and fails for some. The phone numbers are Swedish eg. +46025XXXXX. I cannot see any issues with limits imposed by google, in terms of maximum sign ins etc. Anybody had similar experience and can give som hints about what to look for? Also, is the problem most likely with google or could there be some quirk with the failing phone numbers?
Advertisement
Answer
Try this
Generate your app’s signing report
Get your SHA-1 or SHA-256 fingerprints.
In Firebase console add these fingerprints to your project settings
OR
Check for proper initiation of recaptchverification
window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign- in-button', { 'size': 'invisible', 'callback': function(response) { // reCAPTCHA solved, allow signInWithPhoneNumber. onSignInSubmit(); } });