react-native-push-notification: Push Notification not displaying in status bar
Bug
Push notifications can able receive in receiver but could not display in Status bar.
Environment info
System:
OS: macOS 10.15.6
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 829.48 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.8.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.13.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK:
API Levels: 23, 25, 28, 29, 30
Build Tools: 28.0.3, 29.0.3, 30.0.0, 30.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-R | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: ^0.63.2 => 0.63.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Library version: “react-native-push-notification”: “^4.0.0”,
Steps To Reproduce - Scenario 1
- Receiver can able to receive notifications from FCM, printing logs
- Notification data is sent jsDelivery.notifyNotification(bundle);
- config.getNotificationForeground() getting false
Steps To Reproduce - UseCase 2
- Receiver can able to receive notifications from FCM, printing logs 2.context is null
- config.getNotificationForeground() getting false …
Describe what you expected to happen:
- Need to display the notification in status bar
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 17
Please do not downgrade. To make notifications work, just follow the changelog and create a Channel. As I said: read the Channel part! Regards
I have the same issue and I read the instructions in the Changelog and I added in my AndroidManifest.xml the configurations for the Channels. In ChangeLog said that default channel is “fcm_fallback_notification_channel” and my problem is that when I send a remote notification (from Firebase console), I don’t see the notification like the @brijeshmkt image. Only I can see the information in my console:
NOTIFICATION: {"channelId": "fcm_fallback_notification_channel", "color": null, "data": {}, "finish": [Function finish], "foreground": true, "id": "404230", "message": "task again", "priority": "high", "sound": null, "tag": "campaign_collapse_key", "title": "new", "userInteraction": false, "visibility": "private"}I can receive push in background, because I close my app and retry to send a new notification and the notification appears in statusbar.
The more curious, is that when I open again the same app and send another notification now sometimes the notification appears in the statusbar and I can see the same information in my console: (with different message of course)
NOTIFICATION: {"channelId": "fcm_fallback_notification_channel", "color": null, "data": {}, "finish": [Function finish], "foreground": true, "id": "-2109342", "message": "With my notification 2", "priority": "high", "sound": null, "tag": "campaign_collapse_key", "title": "What happend", "userInteraction": false, "visibility": "private"}Why doesn’t show the notification the first time that I send push? (I tried installed and uninstalled the app to replicate the same behavior) What’s wrong?
For future reference, the solution is here. Change the
android:valuetotrueThis is what I have in my manifest file:
And this is how I’ve created the channel:
RN version : 0.63.4 react-native-push-notification: ^7.2.3,
Can you tell me where I might be making a mistake ? I’m not able to see the notification the first time in foreground. Thanks. @prasad456 @brijeshmkt @jrartiga
I have the same issue. Changing to 5.1.1 solved my problem.
I uninstalled the previous version and installed the new one