ShipNative
PricingBlogFAQContact
Build my app
ShipNative
PricingBlogFAQContact
Build my app

Try ShipNative

Plan your app free

Describe it and get the plan and every screen designed. Building starts at $29/mo.

Build my app
Blog/Guide

Updated November 2026•10 min read

Push Notifications in Expo: Setup, Tokens, and Receipts

Saurabh Singh
Saurabh SinghFounder of ShipNative
Push notifications in an Expo app have four moving parts: credentials for each platform, a token for each device, a server that sends, and a receipt that tells you what happened. This guide covers all four, and two steps that are easy to leave out: checking receipts, and opening the right screen when a tap starts a closed app. The setup, limits, and error codes are checked against the current Expo docs.

The short version

  1. Install the library and add the config plugin
  2. Set up credentials for both platforms
  3. Make a development build
  4. Ask for permission and get the Expo push token
  5. Send from your server
  6. Check the push receipts
  7. Handle the tap

What you need before any code

The code is the short part. Most of the time goes into accounts and credentials, so collect these first.

You needWhere it comes fromGood to know
A development buildeas build with a development profileExpo Go cannot receive push from SDK 53.
Paid Apple Developer accountdeveloper.apple.comNeeded to generate the iOS push key. EAS creates the key for you.
Firebase projectFirebase ConsoleAndroid push goes through Firebase Cloud Messaging (FCM V1).
google-services.jsonFirebase Console, project settingsLives in your project. Holds public identifiers, so it can be committed.
Service account key (JSON)Firebase Console, Service accounts, Generate new private keyPrivate. Upload it with eas credentials and keep it out of git.
Something to test onA phone, an Android Emulator with Google Play services, or an iOS Simulator on Xcode 14+An emulator image without Google Play services will not work.

The two Android files are easy to mix up. google-services.json identifies your app to Firebase and ships inside the build. The service account key lets Expo send on your behalf and never leaves your Expo account. The Expo docs cover both in Add Android FCM V1 credentials.

Local or remote: check which one you need

A local notification is scheduled by the app on the device itself: a daily reminder, a timer that ends, a habit nudge. It needs no server, no credentials, and it works in Expo Go. A push notification, also called a remote notification, is sent from a server because something happened elsewhere: a new message, an order update.

If every notification in your app can be planned ahead on the device, use local notifications and skip the rest of this guide. If a server decides when to notify, read on.

Step 1: Install the library and add the plugin

npx expo install expo-notifications expo-constants

expo-notifications asks for permission and returns the token. expo-constants reads your project ID from the app config. Then add the plugin, and the path to google-services.json for Android:

{
  "expo": {
    "plugins": ["expo-notifications"],
    "android": {
      "googleServicesFile": "./google-services.json"
    }
  }
}

The plugin is why you never edit native files. It also takes options for the Android notification icon and colour, listed in the expo-notifications reference. The Android icon must be all white on a transparent background, or it shows as a grey square.

Step 2: Set up credentials and make a development build

Android. In the Firebase Console, open Settings, then Service accounts, and generate a new private key. Run eas credentials, choose Android, then Google Service Account, and upload that JSON file as the key for push notifications (FCM V1). Download google-services.json from the same Firebase project and put it at the path you set in Step 1.

iOS. Register your test device, then start the build. The first time, the EAS CLI asks whether to set up push notifications and whether to generate a new Apple Push Notifications service key. Answer yes to both.

# First build asks to set up push for iOS. Answer yes to both prompts.
eas build --profile development --platform all

# Then run the dev server and open the development build.
npx expo start

From here on you open the development build, not Expo Go. The full walkthrough with screenshots is in the Expo push notifications setup guide, and the difference between the two apps is in our Expo Go vs development build post.

Step 3: Ask for permission and get the token

import { Platform } from 'react-native';
import * as Notifications from 'expo-notifications';
import Constants from 'expo-constants';

// Decides what happens when a notification arrives while the app is open.
Notifications.setNotificationHandler({
  handleNotification: async () => ({
    shouldPlaySound: true,
    shouldSetBadge: true,
    shouldShowBanner: true,
    shouldShowList: true,
  }),
});

export async function registerForPushNotifications() {
  // Android 13+: the permission prompt only appears once a channel exists.
  if (Platform.OS === 'android') {
    await Notifications.setNotificationChannelAsync('default', {
      name: 'default',
      importance: Notifications.AndroidImportance.MAX,
    });
  }

  const { status: existing } = await Notifications.getPermissionsAsync();
  let status = existing;
  if (existing !== 'granted') {
    status = (await Notifications.requestPermissionsAsync()).status;
  }
  if (status !== 'granted') return null;

  const projectId =
    Constants?.expoConfig?.extra?.eas?.projectId ?? Constants?.easConfig?.projectId;
  if (!projectId) throw new Error('Project ID not found');

  const token = (await Notifications.getExpoPushTokenAsync({ projectId })).data;
  return token; // "ExponentPushToken[...]". Save it on your server.
}

Three details in this code are easy to miss:

  • The Android channel comes first. On Android 13 and later, the permission prompt does not appear until at least one channel exists, and the channel must be created before you ask for a token.
  • Pass the project ID yourself. A development build sets it automatically, but Expo recommends reading it from the app config, so the token stays tied to the project if the account is renamed or the project is transferred.
  • Set the handler, or nothing shows while the app is open. When your app is on screen, it decides whether a notification appears. setNotificationHandler is where you say yes.

Call the function after the user has done something that makes a notification useful, such as joining a chat or placing an order, and save the returned token on your server against that user. One user can have several tokens, one per device.

To confirm the build works before you write any server code, paste the token into the Expo push notifications tool and send yourself a test.

Step 4: Send from your server

Sending is one HTTPS request to Expo. Expo passes the message to FCM for Android and APNs for iOS. This works from a terminal:

curl -H "Content-Type: application/json" \
  -X POST "https://exp.host/--/api/v2/push/send" \
  -d '{
    "to": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
    "title": "New message",
    "body": "Alex sent you a message.",
    "data": { "url": "/chat/42" }
  }'

On a real server, use one of the SDKs. Expo maintains the Node one, expo-server-sdk, which splits large batches, compresses requests, and throttles for you:

import { Expo } from 'expo-server-sdk';

const expo = new Expo();

export async function sendPush(tokens, title, body, data) {
  const messages = tokens
    .filter((token) => Expo.isExpoPushToken(token))
    .map((to) => ({ to, sound: 'default', title, body, data }));

  const tickets = [];
  // At most 100 messages per request. The SDK splits them for you.
  for (const chunk of expo.chunkPushNotifications(messages)) {
    tickets.push(...(await expo.sendPushNotificationsAsync(chunk)));
  }
  return tickets; // store each ticket id, you need it for the receipt
}

The limits to design around, from the Expo docs:

  • At most 100 messages in one request, all for the same project.
  • At most 600 notifications per second per project.
  • The whole payload for one notification must be 4096 bytes or less.
  • The service is free, and it has no uptime guarantee, so retry on network errors, 429, and 5xx.

By default anyone holding a push token can send to it. If that worries you, turn on enhanced push security in your Expo account and send an access token with each request. The message fields, including priority, channelId, badge, and ttl, are listed in Send notifications with the Expo Push Service.

Step 5: Check the receipts

This step is easy to skip, and it is the only way to learn that a notification failed. A send goes through two stages, and each one answers separately:

  • Push ticket. Returned straight away. A status of ok means Expo received the message, not that the user did.
  • Push receipt. Available after Expo has handed the message to Apple or Google. It tells you whether they accepted it.

Expo recommends fetching receipts 15 minutes after sending. They are deleted after 24 hours, so a job that runs once a day can miss them.

export async function checkReceipts(ticketIds) {
  for (const chunk of expo.chunkPushNotificationReceiptIds(ticketIds)) {
    const receipts = await expo.getPushNotificationReceiptsAsync(chunk);

    for (const [id, receipt] of Object.entries(receipts)) {
      if (receipt.status === 'ok') continue;
      if (receipt.details?.error === 'DeviceNotRegistered') {
        // The app was uninstalled or permission was revoked.
        // Delete the token that belongs to this ticket id.
      }
      console.error(id, receipt.message, receipt.details);
    }
  }
}

The errors worth handling in code:

ErrorWhere it appearsWhat to do
DeviceNotRegisteredTicket or receiptStop sending to this token. Delete it from your database.
MessageTooBigReceiptThe whole payload must be 4096 bytes or less. Send an ID in data and fetch the rest in the app.
MessageRateExceededReceiptToo many messages to one device. Retry later with a growing delay.
MismatchSenderIdReceiptThe FCM key and google-services.json belong to different Firebase projects. Use one project for both.
InvalidCredentialsReceiptThe push credentials are missing or revoked. Run eas credentials and add them again.
TOO_MANY_REQUESTSWhole requestYou passed 600 notifications per second for the project. Throttle and retry.
PUSH_TOO_MANY_NOTIFICATIONSWhole requestMore than 100 messages in one request. Split the batch.

Even a receipt of ok is not proof of delivery. It means Apple or Google took the message. If the phone is off, they hold it and try later.

Step 6: Open the right screen on tap

Put a URL in the notification’s data and route to it when the user taps. The catch is the cold start: if the app was closed, the tap happens before your listener exists, so a listener alone misses it. Read the last response at startup as well. This is the pattern from the Expo docs for Expo Router, placed in the root layout:

import { useEffect } from 'react';
import * as Notifications from 'expo-notifications';
import { Slot, router } from 'expo-router';

function useNotificationObserver() {
  useEffect(() => {
    function redirect(notification: Notifications.Notification) {
      const url = notification.request.content.data?.url;
      if (typeof url === 'string') {
        router.push(url);
        Notifications.clearLastNotificationResponse();
      }
    }

    // The app was closed and a tap opened it.
    const response = Notifications.getLastNotificationResponse();
    if (response?.notification) redirect(response.notification);

    // The app was already running.
    const subscription = Notifications.addNotificationResponseReceivedListener((r) => {
      redirect(r.notification);
    });
    return () => subscription.remove();
  }, []);
}

export default function Layout() {
  useNotificationObserver();
  return <Slot />;
}

clearLastNotificationResponse stops the same notification from redirecting again the next time the layout mounts. If your screens do not have URLs yet, set that up first with the Expo deep linking walkthrough.

What happens in each app state

The same notification behaves differently depending on where your app is when it arrives. For a normal notification with a title and body:

App isWho shows the notificationYour code
Open, on screenYour app decides, through setNotificationHandleraddNotificationReceivedListener fires
In the backgroundThe system shows itNothing runs until the user taps
ClosedThe system shows itNothing runs until the user taps

Running code in the background without showing anything is a different kind of message, which Expo calls a headless background notification. It needs extra iOS configuration, and neither platform promises to run it: Android can hold it back in Doze mode, and Apple advises sending no more than two or three an hour. Use a normal notification unless you truly need background work. The details are in What you need to know about notifications.

When a notification does not arrive

Work down this list in order. Each line rules out one layer.

  1. Read the ticket and the receipt. An error there names the cause. Nothing else on this list is worth trying until you have looked.
  2. Schedule a local notification. If that shows up, your permission and handler code are fine, and the problem is the server or the credentials.
  3. Works in development, fails in the store build. The store build needs your own credentials. Check that the FCM V1 key and the iOS push key are both on the project.
  4. Android delivers some and drops others. Send with priority: "high". Normal priority can wait while the phone sleeps.
  5. Android shows nothing at all. If you set a channelId that the app never created, the notification is not displayed. Also, an app the user force-stopped in Android settings receives nothing until it is opened again.
  6. iOS arrives silently or without a badge. The user can allow notifications but turn off sounds or badges. getPermissionsAsync reports both under ios.allowsSound and ios.allowsBadge.
  7. iOS error about a missing aps-environment entitlement. No push key is set up for the project. Run a new iOS build and let EAS create one.

Expo keeps a longer list in its push notifications troubleshooting and FAQ.

Where ShipNative fits

ShipNative builds a React Native app from a description and lets you download it as an Expo project. It does not add push notifications to the apps it builds today. To add them, download the project and follow the steps above. The project is a standard Expo app, so nothing here needs changing, and the credentials stay in your own Apple, Firebase, and Expo accounts.

Saurabh Singh

Written by

Saurabh Singh

Founder of ShipNative. Saurabh builds the product, answers support, and writes every guide on this site.

About

Frequently Asked Questions

Do push notifications work in Expo Go?

Remote push does not. From Expo SDK 53, Expo Go no longer supports push notifications, so you test them in a development build. Local notifications, the ones your app schedules on the device itself, still work in Expo Go.

Do I need to eject from Expo to use push notifications?

No. expo-notifications ships a config plugin, so you add it to the plugins array in your app config and make a development build. There is no native project to edit by hand. If you already have an existing React Native app with its own ios and android folders, the library works there too, with manual setup.

How much does the Expo push notification service cost?

Nothing. Expo states there is no cost for sending notifications through its push service. The limit is a rate, not a price: 600 notifications per second per project, and at most 100 messages in one request.

Can I test push notifications on a simulator?

Yes, on recent tooling. The Expo docs list three options: a physical Android or iOS device, an Android Emulator with Google Play services, and an iOS Simulator on Xcode 14 or later (macOS 13+, iOS 16+). An emulator image without Google Play services cannot receive push.

When does an Expo push token change?

Rarely. It stays the same across app upgrades, and on iOS it survives uninstalling and reinstalling the app. On Android a reinstall may produce a new token. It also changes if you change the application ID. It never expires, but once a user uninstalls the app you get a DeviceNotRegistered error and should stop sending to that token.

Why do notifications work in development but not in the store build?

Check credentials first. The store build needs your own push credentials: an FCM V1 service account key for Android and a push key for iOS, both stored with your Expo project. If the iOS push key was revoked, run eas credentials and generate a new one. A new key does not change your users’ Expo push tokens.

Should I use the Expo push service or talk to FCM and APNs directly?

Start with the Expo push service: one token format and one HTTP endpoint cover both platforms. Go direct when you need features only FCM or APNs expose. The library does not lock you in. getDevicePushTokenAsync returns the native token, which you can use with any other service.

→

Expo Go vs Development Build

Why push needs a development build, and how to make one.

Read guide →
→

Expo Deep Linking Setup

Give every screen a URL so a notification can open it.

Read guide →

Ship a real React Native app today

Describe, preview, and export Expo code, free to start.

Build with ShipNative
ShipNative

Build mobile apps with AI. Describe it, try it on your phone, own the code.

Features

Text to App AIApp Generator from ScreenshotPRD to Mobile AppDesign References

Tools

All free toolsApp Cost CalculatorApp Name GeneratorApp Store Keyword ToolReact Native Components

Blog

All blog postsHow to Build an App Without CodingBest AI Tools for Real Mobile AppsExpo EAS App Store ChecklistLovable, Cursor & v0 for MobileBest AI App Builders in 2026React Native AI App Builder Guide
© 2026 ShipNative
PrivacyTermsRefundsAboutFAQPricingDiscordShipNative - Featured on Startup FameFeatured on Twelve ToolsFeatured on TinyShelfShipNative - Launched on Fazier