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
20 lines (16 loc) • 891 B
text/typescript
import { UnavailabilityError } from 'expo-modules-core';
import NotificationPresenter from './NotificationPresenterModule';
/**
* Removes notification displayed in the notification tray (Notification Center).
* @param notificationIdentifier The notification identifier, obtained either via `setNotificationHandler` method or in the listener added with `addNotificationReceivedListener`.
* @return A Promise which resolves once the request to dismiss the notification is successfully dispatched to the notifications manager.
* @header dismiss
*/
export default async function dismissNotificationAsync(
notificationIdentifier: string
): Promise<void> {
if (!NotificationPresenter.dismissNotificationAsync) {
throw new UnavailabilityError('Notifications', 'dismissNotificationAsync');
}
return await NotificationPresenter.dismissNotificationAsync(notificationIdentifier);
}