Skip to main content

expo-notifications

Version: 55.0.7 Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications. Supports both local and remote push notifications.

Installation

Usage

API Reference

Permissions

(request?: NotificationPermissionsRequest) => Promise<NotificationPermissionsStatus>
Requests notification permissions
() => Promise<NotificationPermissionsStatus>
Gets current permission status

Push Tokens

(options?: ExpoPushTokenOptions) => Promise<ExpoPushToken>
Gets Expo push token
() => Promise<DevicePushToken>
Gets native device push token (FCM/APNs)

Local Notifications

(request: NotificationRequestInput) => Promise<string>
Schedules a local notification
(content: NotificationContentInput) => Promise<string>
Shows notification immediately
(identifier: string) => Promise<void>
Cancels scheduled notification
() => Promise<void>
Cancels all scheduled notifications
() => Promise<Notification[]>
Gets all scheduled notifications

Notification Management

(identifier: string) => Promise<void>
Dismisses displayed notification
() => Promise<void>
Dismisses all displayed notifications
() => Promise<Notification[]>
Gets currently displayed notifications

Badge Count

(count: number) => Promise<boolean>
Sets app badge count
() => Promise<number>
Gets current badge count

Event Listeners

(listener: (notification: Notification) => void) => Subscription
Listens for received notifications
(listener: (response: NotificationResponse) => void) => Subscription
Listens for notification taps

Configuration

(handler: NotificationHandler | null) => void
Configures notification behavior
(identifier: string, channel: NotificationChannel) => Promise<NotificationChannel | null>
Creates/updates Android notification channel

Examples

Complete Setup

Schedule Notification

Handle Notification Tap

Platform Support

Configuration

app.json

Permissions

iOS: Add to app.json:
Android: Permissions automatically added.

Best Practices

  1. Request Permissions: Always request before sending notifications
  2. Configure Handler: Set notification handler before listeners
  3. Clean Up: Remove listeners in component cleanup
  4. Android Channels: Create channels for Android 8+
  5. Error Handling: Handle permission denials gracefully
On iOS, notifications may not appear when app is in foreground unless configured in notification handler.

Resources