@salakar, @ashoat, @indexzero, @swaagie, @3rdeden, and @msluther met today to discuss this. This is the draft proposal written up during that meeting. We plan to iterate on this over the next week and then post it into a new proposal in
react-native-community.A recording of that meeting can be found below in MP4 format.
- Push Notification packages
- react-native-push-notification
- react-native-notifications
- Fork of iOS work used in react-native-fire
- react-native-firebase
- React Native Firebase
- src/messaging
- src/notifications
- Messaging vs. Notifications
- Message (aka "data message")
- Notification always notifies presents a visual notification
-
Formally deprecate existing
PushNotficiationiOSMove source code forPushNotificationiOSinto it's own repo (e.g.push-notification-iosliving at react-native-community/push-notification-ios).- This module will be immediately deprecated. Having a final installable resting place for the code is still important to support the React Native community as they upgrade to newer versions. For example: assume
PushNotificationiOSis removed in[email protected]. Ifpush-notification-iosdoes not exist in user-land React Natiive consumers will be blocked from upgrading until they migrate to the new user-land module. With the deprecated code in a blessed location they can decouple that upgrade from the migration.
- This module will be immediately deprecated. Having a final installable resting place for the code is still important to support the React Native community as they upgrade to newer versions. For example: assume
-
Create a new PushNotification "kernel" Replicate, extract, or copy
messagingandnotificationscode fromreact-native-firebaseinto a new codebase (e.g. react-native-community/react-native-push if not taken already).- Please see "Requirements" below.
- The final future API for this library is TBD – we want input from the community to help finalize it.
- By separating this from
react-native-firebasemore folks can contribute to it without needing to fully understand all of the additional featuresreact-native-firebaseoffers.
- Formally deprecate
PushNotificationiOSin[email protected] - Remove
PushNotificationiOSin[email protected] - Provide guidance for receiving a notification while the JS runtime is off.
- Only supported by Android currently.
- Was brought up as having JSI implications for React Native by @ashoat
- Also see other "Open Questions" below.
- Registering with Remote Services (APN, FCM)
- Stackable notifications
- Updating badge counts
- Creating local notifications without registering with a remote service.
- Rescind notification (using local notification)
- https://facebook.github.io/react-native/docs/headless-js-android
- https://rnfirebase.io/docs/v5.x.x/messaging/receiving-messages#3
- Schema was enforced to avoid booting up the JS run time
- Explicitly will not support legacy services.
- On Android this means not supporting GCM.
- Should we support below iOS 10?
- Only 2% of devices use iOS 9 or lower: https://developer.apple.com/support/app-store
- Platform specific features
- iOS has support for richer notifications: buttons, voip, etc.
- https://react-native.canny.io/feature-requests/p/headless-js-for-ios
- https://github.com/NoilPaw/react-native/commit/799caaa8b14413a94f65b8be7e5de834d26d89a8
- example of ReactInstanceManager usage - https://github.com/evollu/react-native-fcm/blob/fa17149d021a85816d75954b7319ed6689a46f71/android/src/main/java/com/evollu/react/fcm/MessagingService.java#L39|in%20react-native-fcm
- https://rnfirebase.io/docs/v5.x.x/notifications/reference/AndroidNotification
- https://rnfirebase.io/docs/v5.x.x/notifications/reference/IOSNotification
- How can we support other services? (e.g. OneSignal, Expo, etc.)
- These should all desugar to FCM or APN under the covers
- Surface requirements around JSI to React Native core team (e.g. receiving a notification while the JS runtime is off).
- Only supported by Android currently