When receiving an FCM from cloud functions in a Flutter app, on iOS the notification appears with a banner and in the system tray as expected. However, on Android the notification appears straight in the system tray without displaying a banner, when the app is terminated or in background.
I am using latest versions of flutter and firebase messaging plugin, and I set the
default_notification_channel_id
in the AndroidManifest.xml
, then I used the Local Notifications Plugin to create an Android Notification Channel with the same name that I did set in AndroidManifest.xml
and I did set importance: Importance.max
for the channel.
I spent a few days trying show Heads up notifications and I red all of the documentations and related issues, but unfortunately it is still not showing. Although I am using the Local Notifications Plugin to show Heads up notifications on foreground with no problems.
At last I used the Local Notifications Plugin to show the notification on FirebaseMessaging.onBackgroundMessage
so I get the Heads up notification, but the original notification that sent by FCM is still in the notification tray.
I appreciate any help.
Edit: The problem was the Android version that I am using for testing, Notification channels is a concept that is specific Android 8 or newer, which is why the API docs state that the method to create channels is only for those versions of Android
Is there any way to show Heads up notification on background on Android 6? How can I the default FirebaseMessaging channel importance?