Gonzalo4488
Gonzalo4488

Reputation: 449

Firebase Phone Auth won't send me the sms with my code

I migrated my app from using Digits Phone Auth to the new Firebase Phone Auth but while I was testing my app I had troubles signing out my user (Already fixed that) so I just deleted it from the "User list" on the console but now every time I try to sign in with that phone number it won't send me the sms with my code, it works fine with any other number but this one. Does someone knows how can I fix this?

Upvotes: 17

Views: 26074

Answers (4)

Ali A. Jalil
Ali A. Jalil

Reputation: 921

Check if you added your phone number as s test phone number as below and delete it, if it in test numbers: 1- go to firebase console and select your project, then select Authentication enter image description here

2-got to phone provider enter image description here

3- go down to phone numbers which adds as test numbers and delete your phone number from this list: enter image description here

Upvotes: 1

cooldesignpro
cooldesignpro

Reputation: 31

I changed my initial loading activity to logout activity through AndroidManifest file. Here is the final version:

<activity android:name=".OtpActivity"></activity>
    <activity android:name=".LoginActivity" />
    <activity android:name=".MainActivity" />
    <activity android:name=".MainPageActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

MainPageActivity was my Logout Activity.

Upvotes: 0

kazimad
kazimad

Reputation: 954

I had the same issue. It was because of adding my phone number to test phone numbers at the firebase console. Remove it from "test devices" section.)

Upvotes: 53

Niraj Niroula
Niraj Niroula

Reputation: 2424

First check the log, if onVerificationCompleted(PhoneAuthCredential cred) is called or not. If called then this might be the cases:

EDIT: I had answered the question assuming android environment. These two cases are relevant to android programming only.

  • Instant verification: in some cases the phone number can be instantly verified without needing to send or enter a verification code.
  • Auto-retrieval: on some devices, Google Play services can automatically detect the incoming verification SMS and perform verification without user action. (This capability might be unavailable with some carriers.).
    In above cases the the verification process is handled automatically without you needing to enter the code.

Else this might be the case:

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.

Refer Authenticate with Firebase on Android using a Phone Number for more information.

Upvotes: 7

Related Questions