"Test pushes show up when the app is in the background, but the moment it is in the foreground they vanish without a sound." I reproduced this myself the week I started an A/B notification test in a healing-sounds app I run. I was convinced the payload was at fault, and I spent an evening reading server logs before I accepted the simpler answer: iOS does not display a notification on its own while your app is in front. Your app has to ask for it.
The display side of expo-notifications shifts a little with each SDK upgrade, so this is a trap I end up rediscovering every time I move to a new SDK. The fix is small once you see it. What follows is the order I now check things in, from the symptom down to the code.
The API names and defaults below were checked against the official expo-notifications docs and type definitions as of November 2026 (the 58.1 line). On an older SDK, some names may be one generation behind.
Start by sending the same notification three ways
Run this quick triage first, so you do not chase the wrong problem:
- Send a push while the app is in the background: the banner appears
- Send the same push with the app open: nothing shows, no sound
- Open Notification Center: the entry is there in history
If those three match, the cause is almost always a missing foreground handler or incomplete display flags. It is not a token, APNs, or FCM problem. Only when the notification is missing from history should you look at your APNs key or certificate, the FCM setup, or the project ID passed to getExpoPushTokenAsync.
Here is the same triage as a table. Working down it from the top has saved me the most detours.
| Symptom | Likely cause | How to check | Fix |
|---|---|---|---|
| Shows in background, nothing in foreground | setNotificationHandler not registered, or registered too late | Does a console.log inside the handler fire? | Register it at module top level in the root (Cause 1) |
| Handler logs, but no banner | Only shouldShowAlert is set, or shouldShowBanner is false | Inspect the keys in the returned behavior | Use shouldShowBanner and shouldShowList (Cause 2) |
| Lands in Notification Center, never as a banner | Permission is PROVISIONAL | ios.status from getPermissionsAsync | Confirm AUTHORIZED; request if needed (Cause 3) |
| Shows even though you returned false, or behaves erratically | handleNotification did not resolve within 3 seconds | Does handleError receive ERR_NOTIFICATION_TIMEOUT? | No slow awaits inside the handler (Cause 1) |
| Nothing in history either | No title or body to render, or delivery itself failed | The payload you sent and the Expo push receipt | Add title and body (Cause 4); otherwise look at tokens |
| Missing only on certain devices or at certain hours | App is not in the Focus mode's Allowed Apps | Settings, then Focus, on the device | Guide the user through their settings (Cause 5) |
| Only notifications with actions misbehave | categoryIdentifier never registered in the app | getNotificationCategoriesAsync output | Ship the category in the app first |
Cause 1: setNotificationHandler is never called, or called too late
iOS does not show foreground notifications unless the app opts in. expo-notifications gives you that opt-in through setNotificationHandler.
// Top of app/_layout.tsx (the Expo Router root), outside any component
import * as Notifications from "expo-notifications";
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowBanner: true,
shouldShowList: true,
shouldPlaySound: true,
shouldSetBadge: true,
}),
});Put it at module top level in your root layout, or just before registerRootComponent. Wrapping it in useEffect is risky, because a push that arrives during cold start can slip through before the effect fires. I first had it inside a component, and the symptom was a single missing notification right after launch, which is a miserable thing to reproduce on purpose.
There is a second limit that is easy to miss. The type definitions state that handleNotification should respond with a behavior within 3 seconds; otherwise the notification is presented anyway and handleError is called. So a handler that asks your server whether to show something will, on a slow connection, show notifications you meant to suppress.
// Before: deciding over the network (past 3 seconds, the decision is ignored)
handleNotification: async (n) => {
const muted = await fetch("https://api.example.com/mute").then((r) => r.json());
return { shouldShowBanner: !muted.value, shouldShowList: true, shouldPlaySound: false, shouldSetBadge: false };
},
// After: keep the inputs in memory; the handler only reads them
let mutedCache = false; // refresh at launch and when settings change
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowBanner: !mutedCache,
shouldShowList: true,
shouldPlaySound: !mutedCache,
shouldSetBadge: false,
}),
handleError: (id, error) => {
console.warn("[notify] handler error", id, error.message);
},
});I keep the After shape because the handler's only job is to answer "show this or not." Whatever it needs to decide is prepared elsewhere, and the handler just reads a value that is already there.
Cause 2: Still using shouldShowAlert
A lot of samples online still look like this:
// Legacy: shouldShowAlert is deprecated. Move to shouldShowBanner / shouldShowList
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: true,
shouldSetBadge: true,
}),iOS 14 split notification surfaces into banner (top of the screen) and list (Notification Center), so a single shouldShowAlert can no longer describe both. The expo-notifications changelog deprecates shouldShowAlert in 0.31.0 (April 25, 2025, the SDK 53 generation), and the type definition now says to specify shouldShowBanner and/or shouldShowList instead.
| Key | What it does on iOS | To show it in the foreground |
|---|---|---|
| shouldShowBanner | Presents a banner at the top | true |
| shouldShowList | Keeps it in Notification Center | true, so it can be found later |
| shouldPlaySound | Plays the sound | Depends on the use case |
| shouldSetBadge | Updates the icon badge | Depends on the use case |
| shouldShowAlert | Legacy, deprecated | Do not write new code with it |
The rule I use fits in one line: if the user should see it now, set both banner and list to true; if later is fine, set list only. An older setup can look healthy while the legacy key is only being mapped underneath, so I would rather move to the new keys before an SDK upgrade than after it.
Cause 3: Permission is stuck at provisional
The common mistake is reading getPermissionsAsync() loosely without ever calling requestPermissionsAsync(). iOS has a provisional state, where notifications are delivered quietly to Notification Center and do not appear as banners. The official docs tell you to rely on ios.status on iOS rather than the root status field.
import * as Notifications from "expo-notifications";
async function ensureNotificationPermission() {
const current = await Notifications.getPermissionsAsync();
// On iOS, decide from ios.status, not the root status (per the docs)
const iosStatus = current.ios?.status;
if (iosStatus === Notifications.IosAuthorizationStatus.AUTHORIZED) return true;
if (current.status === "granted" && iosStatus === undefined) return true; // Android
const requested = await Notifications.requestPermissionsAsync({
ios: {
allowAlert: true,
allowSound: true,
allowBadge: true,
},
});
return requested.ios?.status === Notifications.IosAuthorizationStatus.AUTHORIZED
|| (requested.status === "granted" && requested.ios === undefined);
}ios.status has five values: NOT_DETERMINED, DENIED, AUTHORIZED, PROVISIONAL, and EPHEMERAL. If you want a foreground banner, AUTHORIZED is the one to confirm. If you use provisional on purpose, I covered that design from another angle in Shipping Notifications Without Asking First — Provisional Authorization in Rork Apps, and the Expo Snippet That Quietly Undoes It.
One more thing worth knowing: on November 23, 2026, expo/expo Issue #54081 reported that on iOS getPermissionsAsync can hold up other modules' async functions while it waits for the system's reply (still open as of November 24). If you run the permission check alongside other startup work, unrelated calls may look slow. I may be overcautious, but I now keep that in mind whenever I suspect launch ordering.
Cause 4: The payload is too thin to render
If the handler returns shouldShowBanner: true but the server sends neither a title nor a body, there is simply nothing to draw. The minimum payload for the Expo Push API looks like this:
{
"to": "ExponentPushToken[YOUR_TOKEN]",
"title": "New wallpapers just arrived",
"body": "See today's pick",
"sound": "default",
"badge": 1
}The docs treat a notification with only data and no title or body as a headless (background) notification, meant for background work rather than display. I keep "show this" and "process this quietly" apart at the payload level.
You may also see older samples carrying a _displayInForeground flag. That is a leftover from older Expo clients, and with setNotificationHandler in place I do not think you need it.
Cause 5: A Focus mode is filtering you out
On iOS 15 and later, if your app is not in the Allowed Apps list of the active Focus, notifications can be held back even while the app is open. Check Settings, then Focus, then each mode, then Allowed Apps on your test device. If you switch between several Focus profiles, check every one of them.
This is not something you can fix on the developer side, but the same question will eventually reach your support inbox, and it makes a good first triage question for user reports.
A category you never registered
If your app uses setNotificationCategoryAsync for action buttons, a categoryIdentifier that the server sends but the app never registered may make display behavior unreliable. When the failure is intermittent, I look here first.
await Notifications.setNotificationCategoryAsync("daily_pick", [
{ identifier: "save", buttonTitle: "Save", options: { opensAppToForeground: false } },
{ identifier: "open", buttonTitle: "Open", options: { opensAppToForeground: true } },
]);
// List what is actually registered
const categories = await Notifications.getNotificationCategoriesAsync();
console.log(categories.map((c) => c.identifier));I ran into this in my app while switching categories during an A/B test. Because only the server changed, the notification disappeared for users on older builds alone, which is a very hard bug to observe. A category added on the server ships in the app first, and is used second. I try never to break that order.
A minimal reproduction screen
Here is everything stitched together as a screen that fires a local notification three seconds after a tap. It removes the server from the loop entirely.
import * as Notifications from "expo-notifications";
import { Button, View } from "react-native";
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowBanner: true,
shouldShowList: true,
shouldPlaySound: true,
shouldSetBadge: true,
}),
});
export default function DebugScreen() {
return (
<View>
<Button
title="Local notification in 3s"
onPress={async () => {
const perm = await Notifications.requestPermissionsAsync();
if (perm.status !== "granted") return;
await Notifications.scheduleNotificationAsync({
content: { title: "Test", body: "Foreground display check", sound: "default" },
// Current versions require an explicit trigger type
trigger: {
type: Notifications.SchedulableTriggerInputTypes.TIME_INTERVAL,
seconds: 3,
},
});
}}
/>
</View>
);
}Tap the button and keep the app in front for three seconds. If a banner appears, your handler and permission are fine, and the problem lives in the server payload or the delivery path. If it does not, the cause sits upstream of the handler: a denied permission or a Focus mode.
Confirm the handler is actually being called
If you have called setNotificationHandler and nothing changes, put logs inside the handler and watch the Xcode console.
Notifications.setNotificationHandler({
handleNotification: async (notification) => {
console.log("[notify] foreground", notification.request.content.title);
return {
shouldShowBanner: true,
shouldShowList: true,
shouldPlaySound: true,
shouldSetBadge: true,
};
},
handleSuccess: (id) => console.log("[notify] presented", id),
handleError: (id, error) => console.warn("[notify] error", id, error.message),
});If [notify] foreground appears, the handler runs, and the cause is the display flags or the permission. If it never appears, the handler is registered too late, or the expo-notifications import is missing. If [notify] error shows ERR_NOTIFICATION_TIMEOUT, you have hit the 3-second limit from Cause 1.
Expo Go, a development build, or TestFlight
Testing in the wrong environment makes a fixed bug look unfixed. Based on the official docs, this is how I decide where to check notifications.
| Environment | Local notifications | Push notifications | Good for |
|---|---|---|---|
| Expo Go | Available | Unavailable on Android since SDK 53; the docs require a development build for push | Handler and local display only |
| Development build | Available | Available | Handler, permission and payload checks with logs |
| TestFlight | Available | Available, production APNs | Differences that appear only in release builds |
My rule is simple: anything involving push goes to a development build, and TestFlight is only for release-only differences. If Expo Go is where your notifications go missing, I wrote up the move in When only notifications fail in Expo Go: three checks, then the shortest move to a development build.
Three misunderstandings worth untangling
First, "if status is granted, the banner will show in the foreground." The docs point iOS apps to ios.status rather than the root status, and a banner needs AUTHORIZED.
Second, "the handler is async, so the system will wait for its answer." Per the type definitions, if it does not resolve within 3 seconds the notification is presented anyway. When a notification you meant to suppress shows up, this is usually why.
Third, "on Android 13+, calling requestPermissionsAsync shows the permission dialog." The docs say the prompt will not appear until at least one notification channel exists, and that setNotificationChannelAsync must be called before getExpoPushTokenAsync.
Check Android while you are here
On Android, a notification channel whose importance is below HIGH will not show a heads-up banner in the foreground. Many people only notice this after fixing iOS, so I add a minimal channel setup at the same time.
import { Platform } from "react-native";
import * as Notifications from "expo-notifications";
export async function prepareAndroidChannel() {
if (Platform.OS !== "android") return;
// On Android 13+, create the channel before asking for permission
await Notifications.setNotificationChannelAsync("default", {
name: "default",
importance: Notifications.AndroidImportance.HIGH,
vibrationPattern: [0, 250, 250, 250],
lightColor: "#FF231F7C",
sound: "default",
});
}Making channel setup an awaitable function lets the caller guarantee it finishes before the permission request and the token fetch.
The next snag: where a tap takes the user
Once foreground display works, the next thing people usually hit is "tapping the notification does not open the right screen." The docs recommend registering NotificationResponseReceivedListener as early as possible, at module top level, on iOS when the app is launched from a killed state by a tap, and suggest also checking useLastNotificationResponse or getLastNotificationResponse during startup.
import * as Notifications from "expo-notifications";
import { useEffect } from "react";
import { router } from "expo-router";
export function useNotificationRouting() {
const last = Notifications.useLastNotificationResponse();
useEffect(() => {
const url = last?.notification.request.content.data?.url;
if (typeof url === "string") router.push(url);
}, [last]);
}With this shape, a cold launch from a tap and a tap while the app is already running both resolve their destination in one place. A cold launch is hard to reproduce outside a real device, so I check it once on a TestFlight build before trusting it.
Prevention, and where I draw the line
- Register
setNotificationHandlerat module top level in the root layout - Use only the iOS 14+ keys,
shouldShowBannerandshouldShowList - Keep network calls out of the handler (the 3-second limit)
- Inspect
ios.statusinstead of trustinggrantedalone - On Android, create the channel before requesting permission or fetching a token
- Hide a "fire local notification" button in the settings screen, so user reports can be triaged quickly
When a notification bug shows up only in release builds, I drop this debug screen into a TestFlight build and find out within the first few hours whether the problem lives in the app or on the device. Early on, I started from the payload far too often and spent a few evenings staring at server logs with nothing in them. Clearing the device side first narrowed my search far more than I expected, and I only noticed that after stepping into this trap a few times.
The app decides what is shown; the server only delivers it. When a notification goes missing, I decide which side of that line I am on before I touch any code.
Start by checking that your setNotificationHandler uses shouldShowBanner and shouldShowList, and that there is no await inside the handler.