UNPKG

expo-notifications

Version:

Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.

12 lines (9 loc) 537 B
import { UnavailabilityError } from 'expo-modules-core'; import NotificationChannelManager from './NotificationChannelManager'; import { NotificationChannel } from './NotificationChannelManager.types'; export default async function getNotificationChannelsAsync(): Promise<NotificationChannel[]> { if (!NotificationChannelManager.getNotificationChannelsAsync) { throw new UnavailabilityError('Notifications', 'getNotificationChannelsAsync'); } return (await NotificationChannelManager.getNotificationChannelsAsync()) ?? []; }