-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Setting FLAG_INSISTENT for Backround notification. #4697
-
Hi, I wanted to know if there is any way I can set FLAG_INSISTENT for the background notifications? I tried to find however, I want unable to find anything about it.
For foreground messages, I'm using flutter_local_notitications and they have an option called additionalFlags where you can set the FLAG_INSISTENT.
My goal is to repeat notification sound like a ringer and show a full-screen intent.
Currently, I'm showing a local full-screen notification from a background message and it does the work, however, I get two notifications created in the system tray, one by flutterfire by default and the other by local notification. If there's any way I can disable the default notification provided by the package also will solve my problem.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
Replies: 2 comments
-
firebase_messaging 8.0.0-dev.14
For anybody who is facing the same problem, I found the solution.
Remove the notification and send only the data part in your message
example:
let message: admin.messaging.Message = {
token: deviceToken,
// notification: {
// title: "New Order Received",
// body: "You have received a new Order.",
// },
data: {
type: "order",
xyz: "Your Data",
...
},
and in your application onBackgroundMessage create a flutter_local_notification.
Beta Was this translation helpful? Give feedback.