expo-notifications
Version:
Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.
17 lines (13 loc) • 652 B
text/typescript
import { UnavailabilityError } from 'expo-modules-core';
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';
/**
* Used to unregister tasks registered with `registerTaskAsync` method.
* @param taskName The string you passed to `registerTaskAsync` as the `taskName` parameter.
* @header inBackground
*/
export default async function unregisterTaskAsync(taskName: string): Promise<null> {
if (!BackgroundNotificationTasksModule.unregisterTaskAsync) {
throw new UnavailabilityError('Notifications', 'unregisterTaskAsync');
}
return await BackgroundNotificationTasksModule.unregisterTaskAsync(taskName);
}