Skip to content

Setting Up iOS Push Notifications with Expo

Send push notifications on iOS using Expo's push service, Apple Push Notification service (APNs), 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, but this guide covers Expo’s push service, the most common path. On iOS, Expo delivers through Apple Push Notification service (APNs). 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
  • An active Apple Developer Program membership
  • A Bundle ID created for your app (see iOS Publishing (Cloud))
  • 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 iOS’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 Apple directly. Skip this if you already have an account, including if you’ve already set this up for Android.

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

3. Enable the Push Notifications capability

Section titled “3. Enable the Push Notifications capability”

This step must be done manually in the Apple Developer portal—there’s no automatic/terminal-based alternative for this part.

  1. Log in to your Apple Developer account and select Identifiers from Certificates, IDs & Profiles.
  2. Find and select the Bundle ID you created for your app.
  3. Scroll to the Capabilities list and check the box next to Push Notifications.
  4. Click Save.

You have two options here—you don’t need to do both.

Section titled “Option A: Let the build process generate it automatically (recommended)”

When you run your local build (see Run a first EAS build for iOS below), the build tool will prompt you to set up push notifications and can generate the APNs key for you automatically, as long as you sign in with your Apple Developer account when prompted. This is the simpler path for most people.

Option B: Generate it manually yourself first

Section titled “Option B: Generate it manually yourself first”

If you’d rather generate the key yourself ahead of time:

  1. Log in to your Apple Developer account, select Certificates, IDs & Profiles, then Keys.

  2. Click the Add button (+).

  3. Enter a name for the key (e.g. “Draftbit Push Notifications”).

  4. Check the box for Apple Push Notifications service (APNs).

  5. Click Continue, then Register.

  6. On the confirmation page, click Download to save your .p8 key file.

  7. Note down the Key ID shown on this page, and your Team ID (found under Membership Details). You’ll provide these along with the .p8 file during the local build if you choose not to let it generate automatically.

The build needs to know which Expo account owns it. Open app.config.js in your exported project and add (or update) the owner field with your Expo username from step 2:

module.exports = {
owner: "your-expo-username",
// ...your existing config
};

If you’re using the AI Agent to make changes locally, you can also just ask it:

“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 iOS build configured. 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 install dependencies: yarn
  3. Install the EAS CLI if you don’t already have it: npm i -g eas-cli
  4. Log in to Expo: eas login
  5. Create and link the EAS project to your account: eas init
  6. Generate the build config: eas build:configure -p ios—this writes eas.json.
  7. Kick off the build: eas build -p ios --profile development
Terminal window
yarn
npm i -g eas-cli
eas login
eas init
eas build:configure -p ios
# ✔ Generated eas.json
eas build -p ios --profile development

This prompts you to set up your Push Notifications key—either automatically (Option A above) or using the .p8 file, Key ID, and Team ID you noted down earlier (Option B above).

Your app’s Expo Project ID is shared across both platforms—it’s one Project ID per app, not a separate one for iOS vs. Android.

  • If you’ve already set up push notifications for Android first, this build will simply find and reuse that same existing Project ID—you’ll see a message like Existing EAS project found for @your-username/your-app-slug (id = ...). Use that same ID; there’s no need to generate a new one.
  • If iOS is the first platform you’re setting this up for, this is the step where the Project ID gets created for the first time—you’d then reuse that same ID later when setting up Android.

Copy the ID from the terminal output, then add it to app.config.js in your Draftbit project too, the same way you did locally in step 6: open Code Editing mode in the builder, edit app.config.js directly to add the extra.eas.projectId field, and save.

If you’re using the AI Agent to make changes in the builder, you can also just ask it:

“Add extra.eas.projectId with value [your ID] to app.config.js.”

This updates the builder’s own copy of app.config.js, so future builds and publishes done through Draftbit’s normal cloud pipeline have the Project ID too.

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 iOS devices.

The AI Agent prompt in step 1 already registers each device’s Expo push token—via expo-notifications’s getExpoPushTokenAsync()—and stores it on the signed-in user’s record. To send a notification to a specific device later, look up that stored token; there’s no separate step needed to fetch it again.

”Missing config” error when running eas credentials

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

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

Notifications aren’t arriving on a device

Section titled “Notifications aren’t arriving on a device”
  • Confirm the Push Notifications capability shows as enabled on your Bundle ID in the Apple Developer portal.
  • 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.