🐛 firebase_messaging: ^9.1.1 Default Background Notification Bug #5704
-
Bug reportDescribe the bug
I am trying to setup my own notification with proper title, body, and styling. but i get a default notification which is having title and body of the notification sent from firebase. How to disable or modify default notification sent by on call of backgroundHandler from FirebaseMessaging ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
To avoid default notification behaviour; don't send a notification payload - send a data only message (which you can't do directly on the Firebase Console UI/Website) via the server SDKS, see https://firebase.flutter.dev/docs/messaging/server-integration Send all the data you need to construct your own notification on the device (this is called a local notification) as keys in the |
Beta Was this translation helpful? Give feedback.
To avoid default notification behaviour; don't send a notification payload - send a data only message (which you can't do directly on the Firebase Console UI/Website) via the server SDKS, see https://firebase.flutter.dev/docs/messaging/server-integration
Send all the data you need to construct your own notification on the device (this is called a local notification) as keys in the
data
object of your FCM message. Then in youronBackgroundMessage
when the data message comes through build your own notification using the data you sent by using a library such as flutter_local_notifications to build and show a local notification.