UNPKG

react-native-notifications

Version:

Advanced Push Notifications (Silent, interactive notifications) for iOS & Android

32 lines (28 loc) 767 B
import { Commands } from './commands/Commands'; import { Platform } from 'react-native'; import { NotificationChannel } from './interfaces/NotificationChannel'; export class NotificationsAndroid { constructor(private readonly commands: Commands) { return new Proxy(this, { get(target, name) { if (Platform.OS === 'android') { return (target as any)[name]; } else { return () => {}; } } }); } /** * Refresh FCM token */ public registerRemoteNotifications() { this.commands.refreshToken(); } /** * setNotificationChannel */ public setNotificationChannel(notificationChannel: NotificationChannel) { return this.commands.setNotificationChannel(notificationChannel); } }