-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel notification when when app is killed by swiping (force kill app) on android #207
Comments
there are few things that need to be considered here
as a result what i'm thinking is
how does that sound? feel free to make suggestions on how to make it better. happy to take a PR that implements this as well. the only concern here is ensuring the service keeps running |
Hi MaikuB, thanks for this amazing flutter plugin. I really need this functionality. I was trying to add a cancelOnAppTermination flag without success. I have add it as a boolean var like this bool cancelOnAppTermination; Also add it to the function and the map in the AndroidNotificationDetails. Could you be more specific about how to do this? Thanks. |
I don't have much more specifics to provide as it's not something I've gotten to look into much besides what I posted above. Generally idea is either the app or plugin needs to know when it's being killed. For plugins, I believe you can register to get callbacks for various activity lifecycle events. Some of the official/first-party plugins do this (e.g. see here). If you do get this working then I'd be happy to look at PR for this |
I will update in case I manage to get this done. Thanks MaikuB. |
Closing this as I don't see myself getting to implement this. PRs from the community are welcome should someone come up with a solution that they want to contribute |
Try this to cancel all the notifications or pass the ID to cancel a specific one.
|
I'm late but my workaround is to use |
Hi MaikuB, thank for your great work,
Can u add an option to create a Service for canceling notification when the app is killed on multitask panel? When I create an ongoing notification with autoCancel is false, there is no way to cancel it when force kills the app.
The text was updated successfully, but these errors were encountered: