notifee: Android: cancelNotification(notificationId) is not working
I want to cancel notification when some event happening. It works on IOS perfectly, but on android it works occasionally. I am using getDisplayedNotifications to find the target one and than I am using
await notifee.cancelNotification(notificationId);
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (9 by maintainers)
@helenaford And I get my id properly
Hi @helenaford , I’ve the same probleme here :
https://github.com/invertase/notifee/issues/434
I am available for tests
For anyone having a similar problem of not able to cancel the notification, it’s more likely due to use of Foreground service. If you’re using a Foreground service, before cancelling the notification, make sure you stop the Foreground service. This will ensure that the notification that was created gets cancelled when calling the
cancel
method