Reputation: 81
Need Help from Firebase community !!
We have implemented Firebase Authentication using Phone provider in Flutter .
Below Plugin configured in pubsec.yaml
firebase_core: ^1.3.0 firebase_auth: ^1.4.1
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: phoneNumberText,
verificationCompleted: (PhoneAuthCredential authCredential) =>
_verificationComplete(
context, authCredential, phoneNum,
updateWrongPhoneUI: updateWrongPhoneUIWidget,
duplicateUser: duplicateUserhandler),
verificationFailed: (FirebaseAuthException exception) =>
_verificationFailed(exception,
updateWrongPhoneUI: updateWrongPhoneUI),
//After 5 attempts - we are getting response astoo-many-requests
codeSent: (String verificationIdLocal, int resendTokenLocal) => _codeSent(
verificationIdLocal, resendTokenLocal,
updateWrongPhoneUI: updateWrongPhoneUI),
** //in this callback we are re-directing to input screen get OTP**
codeAutoRetrievalTimeout: (String verificationId) {
print('FirebaseAuth ' 'Code auto retrieval Timedout');
},
);
Problem: After attempts of Phone authentication on same Phone number for 5 times, the SMS (OTP) stops flowing.
We are running on SPARK pricing plan.
Upvotes: 1
Views: 2477
Reputation: 31
Now you can able to add upto 10 fictional(test) phone numbers.
Means you can able to use these phone numbers for testing purpose
now go here And enable Identity Platform and click providers then click the edit button on the phone Auth
Then a screen will show up, In that add your testing phone number(ex +919876543210) and your own OTP (ex 123456 )
Note: before adding your mobile number for testing make sure to remove your mobile number in the existing authentication tab other wise it won't work
Upvotes: 0
Reputation: 101
according to their support team the limit is 5 sms per 4 hours.
Upvotes: 2
Reputation: 7716
The messages are throttled if sent to the same phone number multiple times within a period of time.
So you can do either of the following:
Here's a quote from the documentation:
To prevent abuse, Firebase enforces a limit on the number of SMS messages that can be sent to a single phone number within a period of time. If you exceed this limit, phone number verification requests might be throttled. If you encounter this issue during development, use a different phone number for testing, or try the request again later.
Upvotes: 1