Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Setting FLAG_INSISTENT for Backround notification. #4697

Unanswered
tehsunnliu asked this question in General
Discussion options

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.

You must be logged in to vote

Replies: 2 comments

Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /