expo-notifications
Version: 
Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.
16 lines (12 loc) • 633 B
text/typescript
import { UnavailabilityError } from 'expo-modules-core';
import NotificationChannelManager from './NotificationChannelManager';
import { NotificationChannelInput, NotificationChannel } from './NotificationChannelManager.types';
export default async function setNotificationChannelAsync(
  channelId: string,
  channel: NotificationChannelInput
): Promise<NotificationChannel | null> {
  if (!NotificationChannelManager.setNotificationChannelAsync) {
    throw new UnavailabilityError('Notifications', 'setNotificationChannelAsync');
  }
  return await NotificationChannelManager.setNotificationChannelAsync(channelId, channel);
}