On 6.0.0 foreground notification no longer appears on Android
See original GitHub issueBug
I have the “notification_foreground” option in AndroidManifest.xml set to “true”, as I would like foreground notifications to appear.
In v5.1.1 of this package the notification appears as expected while the app is in the foreground.
When I update to 6.0.0 the notification no longer appears. Notifications continue to appear while the app is in the background ok.
When I roll back to 5.1.1 (with no other changes) the foreground notifications appear again.
Has something changed in 6.0.0 which would affect this behaviour?
Thanks
Environment info
react-native info
output:
// paste it here
Library version: 6.0.0
Steps To Reproduce
- Install 6.0.0 of this library
- Set “notification_foreground” to true in AndroidManifest.xml
- Run the app on Android
- Trigger a remote notification while the app is open in the foreground
- Don’t see the notification appear
- Roll back to 5.1.1 and repeat the steps
- See the notification appear while the app is open in the foreground …
Describe what you expected to happen:
Foreground notification behaviour doesn’t change between version 5.1.1 and 6.0.0.
Reproducible sample code
Issue Analytics
- State:
- Created 3 years ago
- Comments:33
Top Results From Across the Web
Unable to receive notification in foreground on Android 8 ...
Got it to work. It's because from Android 8 you need to create a channel // Build a channel const channel = new...
Read more >Receive messages in an Android app - Firebase - Google
Firebase notifications behave differently depending on the foreground/background state of the receiving app.
Read more >Android 6.0 Changes | Android Developers
The adb shell dumpsys notification command no longer prints out your notification text. Use the adb shell dumpsys notification --noredact ...
Read more >flutter_local_notifications 6.0.0 | Flutter Package - Pub.dev
A cross platform plugin for displaying and scheduling local notifications for Flutter applications with the ability to customise for each platform.
Read more >Releases | Notifee
To learn more, view the Foreground Notifications documentation ... [Android]: Fixes an issue where the current version of Notifee does not build when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey I’m using version 7.0.0 and I’m experiencing same problem. I’ve created my channel:
And I’m reacting to notification like this:
It works when application is in background but not when it’s in foreground. Do you know what could I be doing wrong?
I just released the version 6.1.0. In your case you can create a channel and define it as default channel for FCM notifications in
AndroidManifest
, the version 6.1.0 allow this also for foreground notifications. Then you don’t need to specify the channel id in your backend. This should keep the compatibility with old versions.