1import { UnavailabilityError } from 'expo-modules-core'; 2 3import NotificationPresenter from './NotificationPresenterModule'; 4import { Notification } from './Notifications.types'; 5 6/** 7 * Fetches information about all notifications present in the notification tray (Notification Center). 8 * > This method is not supported on Android below 6.0 (API level 23) – on these devices it will resolve to an empty array. 9 * @return A Promise which resolves with a list of notifications ([`Notification`](#notification)) currently present in the notification tray (Notification Center). 10 * @header dismiss 11 */ 12export default async function getPresentedNotificationsAsync(): Promise<Notification[]> { 13 if (!NotificationPresenter.getPresentedNotificationsAsync) { 14 throw new UnavailabilityError('Notifications', 'getPresentedNotificationsAsync'); 15 } 16 17 return await NotificationPresenter.getPresentedNotificationsAsync(); 18} 19