expo-notifications

expo-notifications Fundamentals

One library covers local and remote notifications, permissions, channels and badges on both platforms:

The main expo-notifications APIs
Task Functions
Permission and tokens requestPermissionsAsync, getExpoPushTokenAsync
Showing now or later scheduleNotificationAsync with a trigger
Arrival in the foreground setNotificationHandler
Reacting to events addNotificationReceivedListener, useLastNotificationResponse

A notification's content (title, body, and a data object for your own fields) is separate from its trigger, which says when: immediately, after an interval, at a date, or on a calendar schedule. By default a notification that arrives while the app is open is not shown at all. setNotificationHandler, called once at module level as in Notification Channels, decides; src/notify/setup.ts now returns shouldShowBanner: true and shouldShowList: true, which replaced the shouldShowAlert that the 57.0.21 types mark deprecated, and logs in the foreground: with the title. Give it a notification icon (white on transparent) through the config plugin, or Android draws a plain circle, as in New Arrival Alerts's figure.