expo-notifications
Version:
Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.
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();
}