NotificationsAndroid.ts 504 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
import { Commands } from './commands/Commands';
import { Platform } from 'react-native';

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
  */
20 21
  public registerRemoteNotifications() {
    this.commands.refreshToken();
22 23
  }
}