3

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?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • We have the exact same problem, with Swedish phone number too. The vast majority works, some individual numbers fail silently. Logs `google.cloud.identitytoolkit.v1.AuthenticationService.SendVerificationCode`. Tried both Identity Toolkit & Identity Platform. – MrAlek Oct 27 '22 at 08:26
  • In case it might help someone: I believed to have this problem, too, until I realized that I had added my own phone number as a phone number for testing within Firebase. Hence, Firebase did not send me a confirmation code via SMS as I had configured a static confirmation code for testing purposes. I know, this is a silly mistake, but it might save someone some time. – Paul Jun 21 '23 at 21:25

1 Answers1

0

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();
 }
});

Or A Carrier issue

skynet-bit
  • 51
  • 4