Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase_auth/invalid-phone-number in flutter?

enter image description here - I'm using phone authentication using firebase in flutter

  • When I enter the number and I'll get the otp,
  • While Entering to the otp field and verify it shows the below error in flutter

I/flutter (27587): [firebase_auth/invalid-phone-number] 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]. [ Invalid format. ]

I was tried sevaral ways but it did't work I was given my verify phone code for firebase given below

>  await auth.verifyPhoneNumber(
>           phoneNumber: phoneNumber,
>           verificationCompleted: verificationCompleted,
>           verificationFailed: verificationFailed,
>           codeSent: codeSent,
>           timeout: const Duration(seconds: 60),
>           codeAutoRetrievalTimeout: codeAutoRetrievalTimeout);

my verify codesin ui section

 await authCalss.verifyPhonenumber(
                                      "+91 ${phonecontroller.text}",
                                      context,
                                      setData);

1 Answers

Your Phone Number must be formatted like this.

enter image description here

like image 165
KurbanAli Masu Avatar answered Dec 22 '25 13:12

KurbanAli Masu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!