Firebase Notification Listener
Overview
This widget listens for Firebase Cloud Messages (FCM) while the app is in the foreground and manually displays notifications using react-native-push-notification. It supports custom channels and sounds by extracting channelId and sound from the incoming message payload.
Documentation
Typical usage scenario
This widget is designed for applications that require real-time user engagement through push notifications. It listens for Firebase Cloud Messaging (FCM) push notifications and ensures that messages are displayed immediately when the app is in the foreground.
Use cases include:
-
Displaying chat messages instantly while the user is in-app.
-
Alerting users about new orders, events, or warnings with a distinct notification sound.
-
Enhancing in-app communication without relying on background handlers.
Features and limitations
-
Listens to FCM push notifications in real-time.
-
Displays notifications while the app is in the foreground.
Dependencies
- @react-native-firebase/app@17.3.0
- @react-native-firebase/messaging@^17.3.0
- react-native-push-notification@8.1.1