Skip to main content

Enable SMS Phone Authentication with Firebase

Use this guide when your app lets users sign in with a phone number. Firebase Phone Authentication requires Firebase Console setup and platform verification setup for reliable production behavior.

Quick Answer

Enable Phone as a Firebase Auth provider, add iOS and Android app credentials that match your app identity, configure APNs for iOS production builds, add Android SHA fingerprints, then test with real devices and Firebase test phone numbers before sending real SMS at scale.

1. Enable Phone Auth

  1. Open Firebase Console.
  2. Select your Firebase project.
  3. Go to Authentication > Sign-in method.
  4. Enable Phone.
  5. Add test phone numbers for development when possible.

Test numbers are useful because they do not send real SMS and are not rate limited like production phone numbers.

2. Confirm Native Firebase Config Files

Phone auth must use the Firebase app entry that matches your native app:

PlatformCheck
iOSBundle identifier and GoogleService-Info.plist.
AndroidApplication id and android/app/google-services.json.

If you changed the bundle identifier or Android application id, update the Firebase app entry and download fresh config files.

3. iOS Setup

For production iOS builds, configure APNs in Firebase:

  1. Open Firebase Console.
  2. Go to Project Settings > Cloud Messaging.
  3. Select the iOS app.
  4. Upload an APNs authentication key or certificate.
  5. Confirm Team ID, Key ID, and bundle identifier match Apple Developer.

Also confirm the iOS app has the correct URL schemes and native configuration generated by your Firebase GoogleService-Info.plist. If the app uses social login or Google Sign-In in addition to phone auth, the reversed client id must match the Firebase file.

4. Android Setup

Add SHA fingerprints to the Android app entry in Firebase.

For debug builds on macOS or Linux:

keytool -list -v \
-alias androiddebugkey \
-keystore ~/.android/debug.keystore \
-storepass android \
-keypass android

For debug builds on Windows:

keytool -list -v ^
-alias androiddebugkey ^
-keystore %USERPROFILE%\.android\debug.keystore ^
-storepass android ^
-keypass android

Copy the SHA-1 and SHA-256 fingerprints into Firebase Console > Project Settings > Your Android app > Add fingerprint.

For release builds, use the upload key or app signing key fingerprint from your Google Play signing setup.

5. Rebuild the App

After changing Firebase config files or native credentials:

cd ios
bundle exec pod install
cd ..
yarn ios
# or
yarn android

Verification Checklist

  • Phone provider is enabled in Firebase Auth.
  • Test phone numbers are configured for development.
  • iOS APNs credentials are uploaded for production.
  • Android SHA-1 and SHA-256 fingerprints are added.
  • Native Firebase config files match the current app id values.
  • A test phone number can sign in on a real device.

Troubleshooting

ProblemFix
SMS never arrivesUse Firebase test numbers first, then check provider limits, country support, and billing/quota.
iOS verification failsCheck APNs credentials, bundle id, and GoogleService-Info.plist.
Android verification failsCheck SHA fingerprints and google-services.json.
Works in debug but not releaseAdd release signing fingerprints to Firebase.
Too many attemptsWait for Firebase rate limits to reset or use configured test numbers.

Next Steps