mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-07 22:41:04 +08:00
* Don't abort registerForRemoteNotifications The native call to `registerForRemoteNotifications` shouldn't be aborted even if `isRegisteredForRemoteNotifications` returns `true`. This is because after successful registration on the first boot, on successive boots the app `isRegisteredForRemoteNotifications` will return true, and then `registerForRemoteNotifications` won't be called again and therefore the APNSToken will never be set (because it is only set on the `didRegisterForRemoteNotificationsWithDeviceToken` swizzled by the `FIRMessagingRemoteNotificationsProxy`) * Set APNSToken on didRegisterForRemoteNotificationsWithDevicetoken This is what `FIRMessagingRemoteNotificationsProxy` does, and doing it here seems to avoid the race condition caused by `didRegisterForRemoteNotificationsWithDeviceToken` here being executed first and resolving the promise before the token is set (at least on iOS 12). It doesn't do any damage anyway to do it here first anyway. Co-authored-by: Russell Wheatley <russellwheatley85@gmail.com>
React Native Firebase - Messaging
React Native Firebase provides native integration of Firebase Cloud Messaging (FCM) for both Android & iOS. FCM is a cost free service, allowing for server-device and device-device communication. The React Native Firebase Messaging module provides a simple JavaScript API to interact with FCM.
Installation
Requires @react-native-firebase/app to be installed.
yarn add @react-native-firebase/messaging
Documentation
License
- See LICENSE
Built and maintained with 💛 by Invertase.
💼 Hire Us | ☕️ Sponsor Us | 💻 Work With Us

