Push Notifications
The kit includes Expo push notifications.Key File
lib/notifications.ts
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Push notifications setup
lib/notifications.ts
import { requestNotificationPermission } from '@/lib/notifications';
const token = await requestNotificationPermission();
await fetch('https://exp.host/--/api/v2/push/send', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
to: 'ExponentPushToken[xxx]',
title: 'Hello!',
body: 'This is a notification',
}),
});
import * as Notifications from 'expo-notifications';
await Notifications.scheduleNotificationAsync({
content: { title: 'Reminder', body: 'Check the app!' },
trigger: { seconds: 3600 },
});