Firebaseui-ios: "The format of the phone number provided is incorrect.

Created on 21 May 2017  ·  9Comments  ·  Source: firebase/FirebaseUI-iOS

I keep getting this error.
"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code]."

here is my code:

PhoneAuthProvider.provider().verifyPhoneNumber("+13231234567", completion: {(_ verificationID: String?, _ error: Error?) -> Void in
            if error != nil {
                // Verification code not sent.
                print()
            }
            else {
                print()
                // Successful.
                // Show the Screen to enter the Code.
                // Developer may want to save that verificationID along with other app states in case
                // the app is terminated before the user gets the SMS verification code.
            }
        })

What is wrong with that format? Plz anyone help. I am using US phone number as example
Now am getting this...
We have blocked all requests from this device due to unusual activity. Try again later.

Great job firebase...

All 9 comments

Problem here that phone number is not real.
We are validating phone number with carrier provider.

@yarodevuci Have you tried using real phone number?

btw you're using headless library (FirebaseAuth) calls, thus please create related tickets in there repo: https://github.com/firebase/firebase-ios-sdk

@yramanchuk sorry about that. And yea i was using real number. Of course I didn't want to share it here

@yramanchuk this problem persists. im using a real phone number and still get the invalid phone number error. why?

I guess it works when i put the "+" before the number but that begs the question, why is it not documented anywhere? And why must the end user worry about formatting? The API should do that in the backend.

I tested with Vietnam phone number, and it's OK with +84989440000

For firebase to Validate any phone number. The country prefix code has to be added. E.g

{ phoneNumber: +23470 3118 *6 }

Adding plus gives indication of country code (+91 for india OR add "(0120) for landline code") that is E164 compliance.

im have this problem by creating a user whit a colombian number "+573234686974"

"+1 323-123-4567" Try sending with this format. you will get VerificationID for sure

Was this page helpful?
0 / 5 - 0 ratings