1import { UnavailabilityError } from 'expo-modules-core';
2
3import NotificationCategoriesModule from './NotificationCategoriesModule.native';
4
5/**
6 * Deletes the category associated with the provided identifier.
7 * @param identifier Identifier initially provided to `setNotificationCategoryAsync` when creating the category.
8 * @return A Promise which resolves to `true` if the category was successfully deleted, or `false` if it was not.
9 * An example of when this method would return `false` is if you try to delete a category that doesn't exist.
10 * @platform android
11 * @platform ios
12 * @header categories
13 */
14export default async function deleteNotificationCategoryAsync(
15  identifier: string
16): Promise<boolean> {
17  if (!NotificationCategoriesModule.deleteNotificationCategoryAsync) {
18    throw new UnavailabilityError('Notifications', 'deleteNotificationCategoryAsync');
19  }
20
21  return await NotificationCategoriesModule.deleteNotificationCategoryAsync(identifier);
22}
23