Skip to content

Setting Up Android Push Notifications with Expo

Send push notifications on Android using Expo's push service, Firebase Cloud Messaging (FCM V1), and the AI Agent

Push notifications let your app reach people even when it’s closed. There’s more than one way to send them—you could call Firebase Cloud Messaging directly, or use a third-party service like OneSignal—but this guide covers Expo’s push service, the most common path. On Android, Expo delivers through Google’s Firebase Cloud Messaging (FCM V1)—the current version of Firebase’s messaging API. Most of this guide is code the AI Agent writes for you; the last two steps happen once in a terminal, because they involve an interactive credential setup that can’t be run through the Builder or the AI Agent.

Before you begin, make sure you have:

  • Your app in Draftbit with the screen(s) you want notifications on
  • Access to the Google account you’ll use for Firebase
  • A free Expo account—step 2 covers creating one
  • A few minutes at a terminal with your project exported (steps 6–7)

1. Design the UI, then ask the AI Agent to wire it up

Section titled “1. Design the UI, then ask the AI Agent to wire it up”

Add the permission prompt, a notifications toggle in settings, or wherever the in-app banner should land. Once the screens exist, ask the AI Agent in AI Chat to connect them using expo-notifications, the library that talks to Android’s notification system on your behalf:

“Add push notification support using expo-notifications. Request permission the first time the user opens the app, register for an Expo push token once permission is granted, and store that token against the signed-in user. Add a listener that shows an in-app banner when a notification arrives while the app is open, and navigates to the relevant screen when the user taps a notification.”

Expo is the service that actually delivers the push—your app sends notifications through it rather than talking to Android directly. Skip this if you already have an account.

  1. Go to expo.dev/signup and sign up with an email or GitHub.
  2. Verify your email from the link Expo sends you.
  3. Note your username—you’ll need it exactly as it appears on your Expo profile in step 5.

Two different files come out of Firebase here, and they’re used in two different places: google-services.json goes into your project, while the service account key never does—it’s uploaded straight to Expo’s servers in step 7.

Register the Android app and download google-services.json

Section titled “Register the Android app and download google-services.json”
  1. Open the Firebase console and select your project, or create one if this app doesn’t have one yet.

  2. Click Add app.

    The Add app button on a Firebase project's home page

  3. Select the Android platform.

    Selecting Android as the platform to add

  4. Enter your app’s package name—it needs to match the package value in your app’s app.config—and click Register app.

    Registering the Android app with its package name

  5. Click Download google-services.json, then Continue to console.

    Downloading google-services.json

    Continuing to the Firebase console

The registered Android app now showing in the Firebase console

  1. Go to Project Settings → Service accounts—it’s a separate tab from Cloud Messaging, not nested under it.

  2. Click Generate new private key. This downloads the FCM V1 service account key—set it aside for step 7.

    Generating a new private key from the Service accounts tab

4. Add google-services.json to your project

Section titled “4. Add google-services.json to your project”

Upload google-services.json to your project’s assets, then ask the AI Agent to move it where the build expects it:

“I uploaded google-services.json to the assets folder. Move it to the project root and tell me the exact filename so I can reference it later.”

The build needs to know which Expo account owns it. Ask the AI Agent to set the owner field to your Expo username from step 2:

“Set the owner field in app.config to my Expo username: your-expo-username.”

Expo can’t manage push credentials for a project until it has at least one Android build configured—that’s what generates eas.json and links your app’s package name to your Expo account. The Builder can’t trigger this part: export your code and run it once from a real terminal.

  1. Export your project from Draftbit.
  2. Open a terminal in the exported folder and log in: eas login
  3. Create and link the EAS project to your account: eas init
  4. Generate the build config: eas build:configure -p android—this writes eas.json.
  5. Kick off the build: eas build -p android --profile development
Terminal window
eas login
eas init
eas build:configure -p android
# ✔ Generated eas.json
eas build -p android --profile development

7. Upload the FCM V1 key to Expo’s credential store

Section titled “7. Upload the FCM V1 key to Expo’s credential store”

There are two ways to do this—pick whichever you prefer.

No terminal needed for this option.

  1. Open your project on expo.dev, go to Credentials, and select your Android application identifier.

    The Expo dashboard's Credentials page, listing the Android application identifier

  2. Under Service credentials, add the FCM V1 service account key using the file from step 3.

    The FCM V1 service account key listed under Service credentials

This runs as a menu-driven prompt, so stay in the same exported project and terminal from step 6—it isn’t something the Builder or the AI Agent can click through remotely.

  1. Start the credentials manager: eas credentials -p android
  2. Pick any build profile when asked—it doesn’t affect the outcome.
  3. Navigate: Google Service Account → Manage your Google Service Account Key for Push Notifications (FCM V1) → Set up a Google Service Account Key for Push Notifications (FCM V1).
  4. If it asks whether to reuse an existing key, choose Upload a new service account key.
  5. Paste the full path to the service account key file from step 3 and hit enter.
Terminal window
eas credentials -p android
# › Google Service Account
# › Manage your Google Service Account Key for Push Notifications (FCM V1)
# › Set up a Google Service Account Key for Push Notifications (FCM V1)
# ? Path to Google Service Account file: ~/Downloads/your-project-firebase-adminsdk.json
# ✔ Google Service Account Key assigned for FCM V1

You’re done with this step once you see Google Service Account Key assigned … for FCM V1 printed in the terminal.

The credential now lives with Expo, not in your exported copy—go back to Draftbit and publish once more so the live build picks it up. From here, a push sent through Expo’s push service reaches real Android devices.

”Missing config” error when running eas credentials

Section titled “”Missing config” error when running eas credentials”

You need at least one Android build configured before credentials can be managed. Run eas build:configure -p android (step 6) first.

It’s an interactive-only command and needs a real terminal—it won’t work over a non-interactive shell, CI runner, or the Builder’s own terminal-like surfaces. Run it locally on your machine.

Notifications aren’t arriving on a device

Section titled “Notifications aren’t arriving on a device”
  • Confirm the Google Service Account Key shows as assigned when you re-run eas credentials -p android.
  • Make sure the device has notification permissions granted and a push token was actually registered—ask the AI Agent to log the token after registration.
  • Rebuild and republish after any credential or app.config change; existing installs won’t pick up new credentials until the next build.