Send a pushData object with a push, then handle taps and deep links with useNativeNotifyPress.
Send pushData
Add a pushData object to the send request, or to the send form in your dashboard:
{
"appId": 12345,
"appToken": "yourAppToken",
"title": "Your order shipped",
"body": "Tap to track your package",
"dateSent": "9-24-2026 3:05PM",
"pushData": { "url": "/orders/12345" }
}
Handle taps
useNativeNotifyPress<T>() returns the pushData of the last tapped notification. It also catches the tap that launched a closed app, which the raw expo-notifications listener misses.
app/_layout.tsx
import { useEffect } from 'react';
import { Slot, router } from 'expo-router';
import { useNativeNotifyPress } from 'native-notify';
export default function RootLayout() {
const { data } = useNativeNotifyPress<{ url?: string }>();
useEffect(() => {
if (data?.url) {
router.push(data.url); // Expo Router — or navigation.navigate(...) with React Navigation
}
}, [data]);
return <Slot />;
}
It also returns the full expo-notifications response as notification, for the title, body or date:
const { data, notification } = useNativeNotifyPress<{ orderId?: string }>();
getPushDataObject() is a hook that returns only the data.
Deep link with the url key
Put a url in pushData and hand it to your router on tap.
- Expo Router:
router.push(data.url)handles nested segments and typed routes. - React Navigation: pass the url through your linking configuration.
Linking.openURL()needs an absolute URL, so send a fullmyapp://…link, or build one from a path withLinking.createURL()fromexpo-linking.
Notification inbox rows carry pushData too, so onNotificationPress works the same way, no listener needed.