UNPKG

expo-quest-notifications

Version:

A fork of [`expo-notifications`](https://github.com/expo/expo/tree/main/packages/expo-notifications) that provides two implementations: - The default `expo-notifications` for Android and iOS platforms. - A Meta Quest-compatible implementation that uses th

16 lines 1.03 kB
import { UnavailabilityError } from 'expo-modules-core'; import NotificationPresenter from './NotificationPresenterModule'; import { mapNotification } from './utils/mapNotificationResponse'; /** * Fetches information about all notifications present in the notification tray (Notification Center). * > This method is not supported on Android below 6.0 (API level 23) – on these devices it will resolve to an empty array. * @return A Promise which resolves with a list of notifications ([`Notification`](#notification)) currently present in the notification tray (Notification Center). * @header dismiss */ export default async function getPresentedNotificationsAsync() { if (!NotificationPresenter.getPresentedNotificationsAsync) { throw new UnavailabilityError('Notifications', 'getPresentedNotificationsAsync'); } return (await NotificationPresenter.getPresentedNotificationsAsync()).map((notification) => mapNotification(notification)); } //# sourceMappingURL=getPresentedNotificationsAsync.js.map