Closed codemeall closed 3 years ago
I think there is a true problem with this feature. Many issues are open, and people says that it don't works, after it works, after it don't works ... For now I think the feature is broken, I tried different parameters to send to this module to cancel local notification, but nothing seems to work? We cannot handle properly the management of notification in our app on android side because of this.
Please, someone confirm that the feature is broken, or give a true solution with explanation, or a link, but not just a "Heyyy it works ty nice !".
Thanks.
Edit : After hours of tryharding, finally I got it works, the function was correctly called, but the notifications stayed. If you give a tag
to your localNotification
, the method clearLocalNotification
don't work. I don't know why, maybe it's normal behavior, but if someone have an explanation, feel free to give it ! :D
@Linoa65 can confirm that removing tag
from notification details allows notification to be cancelled with cancelLocalNotifications
Hi All,
After a one day struggle I found the way to delete the delivered notification by ID. Here is how I solved my problem.
PushNotification.clearLocalNotification(parseInt(id, 10));
Please let me know if I am making any mistake.
@athondapu Thank you, that worked for me 🙂 Although, typescript compiler is complaining and this method isn't mentioned anywhere in the docs.
@athondapu This did not work for me I have read elswhere that removing the tag attribute from localnotification was also an issue, but neither solutions worked. Could I please trouble you to share a full example? Thank you.
I have a problem with deleting delivered notifications, cancel Local Notification doesn't work, I tried all solutions that I read
Hi i'm also having the issue of removing delivered notifications i checked the documentation it seems only IOS has the function to remove delivered notification via PushNotificationIOS.removeDeliveredNotifications(identifiers);
but what about the android's removal on delivered notifications
Hi @willnaoosmit Check that: https://github.com/zo0r/react-native-push-notification/blob/master/index.js#L420
Hi @willnaoosmit Check that: https://github.com/zo0r/react-native-push-notification/blob/master/index.js#L420
Hi i checked on the documentation, the function of clearLocalNotification() is used to cancel operations not removing delivered notifications. Because i have tried using the function it works for canceling scheduled notifications, but not on removing delivered notifications
PushNotification.cancelLocalNotifications({ id: scheduledNotificationId });
cancelLocalNotifications The id parameter for PushNotification.localNotification is required for this operation. The id supplied will then be used for the cancel operation. https://github.com/zo0r/react-native-push-notification#1-cancellocalnotifications
I am unable to cancel Delivered localnotification with their ID.