UNPKG

@dream11mobile/react-native-firebase

Version:

A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto

26 lines (20 loc) 574 B
import { getNativeModule } from '../../utils/native'; import { isIOS } from '../../utils'; import type Messaging from './'; export default class IOSMessaging { constructor(messaging: Messaging) { this._messaging = messaging; } getAPNSToken(): Promise<string | null> { if (!isIOS) { return null; } return getNativeModule(this._messaging).getAPNSToken(); } registerForRemoteNotifications(): Promise<void> { if (!isIOS) { return undefined; } return getNativeModule(this._messaging).registerForRemoteNotifications(); } }