Home » Android » android – Firebase Phone Auth won't send me the sms with my code

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

Posted by: admin June 15, 2020 Leave a comment


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?

How to&Answers:

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.)


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.


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">
            <action android:name="android.intent.action.MAIN" />

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

MainPageActivity was my Logout Activity.