-
Notifications
You must be signed in to change notification settings - Fork 61
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
User kill app, notification not remove #25
Comments
Some update? |
This is valid at least on Android 10+. When there is music playing by the Ionic app, the Music Controller won't be closed when killing the app. Also when issuing the destroy() command from the code, while the When a .destroy() is called, it shouldn't matter if |
Faced this problem as well, i had to write a custom service to remove the persisting notification after app kill. |
@kpwa You can indicate more about this. Thanks |
|
I'm not clear on the description of this problem... but I'll add some things I've observed. On my Android 12 (S21) device, and on the simulator, notifications are not visible in the notification pull down after I swipe away the app. So maybe the original problem as reported is fixed by Android itself, though, it probably also depends on the UI flavor in use. However, notifications do build up under App Info -> Notifications -> Notification Categories in that a new one is created each time I kill the app while the notification is active. I've tracked this back to the random UUID assigned to the CHANNEL_ID in MusicControlsNotification.java. If I assign a static value to this variable instead, then they stop multipling. I've seen at least one other fork make a similar change. It appears that @ghenry22 changed it to the random UUID back in this change, which appears to fix an issue where multiple app don't intend to share the same CHANNEL_ID. But the effect of creating new ones each time a notification is shown is a potential build up of notifications internally. I would suggest letting the user pass in their own CHANNEL_ID (or if convenient, make one up one time, and store in app data) But, after I removed the random channel id here, I'm finding that each time my app updates the notifications (e.g. starts a new track) it is only reflecting the next-to-last title/image that I gave it. The NotificationManager.notify() docs say that it will update an existing notification, but it's clearly not doing that consistently. Logging shows that I am in deed building a new notification with the expected information, but it's not showing after calling notify(). But that older information will show up the next time it calls notify() with new information. -- Update -- |
@kpwa Any one else found any solution to this? |
Hi i use this plugin in Android app now. When user or OS kill app notification does not disappear. Please help to solve this.
The text was updated successfully, but these errors were encountered: