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
17 lines (13 loc) • 662 B
text/typescript
import { UnavailabilityError } from 'expo-modules-core';
import NotificationScheduler from './NotificationScheduler';
/**
* Cancels all scheduled notifications.
* @return A Promise that resolves once all the scheduled notifications are successfully canceled, or if there are no scheduled notifications.
* @header schedule
*/
export default async function cancelAllScheduledNotificationsAsync(): Promise<void> {
if (!NotificationScheduler.cancelAllScheduledNotificationsAsync) {
throw new UnavailabilityError('Notifications', 'cancelAllScheduledNotificationsAsync');
}
return await NotificationScheduler.cancelAllScheduledNotificationsAsync();
}