react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

cancelLocalNotification does not cancel a notification with tag

Open andidev opened this issue 4 years ago • 6 comments

Create a local notification with tag

PushNotification.localNotification({                        
    channelId: 'DELIVERY',                                 
    id: '123',                                             
    tag: 'DELIVERY',                                       
    title: "Title",                                        
    message: "Message"                                    
});                                                                

Try to cancel it with the id as documented:

PushNotification.cancelLocalNotification('123');   

It does not get cancelled. If I dont add a tag to the notification using cancelLocalNotification works.

andidev avatar Sep 09 '21 23:09 andidev

Hi @andidev

For delivered notification, you can use:

PushNotification. clearNotification(tag, id);

Regards

Dallas62 avatar Sep 10 '21 08:09 Dallas62

I tried that as well but it throws an error unfortunately.

andidev avatar Sep 10 '21 08:09 andidev

@andidev Did you solved?

KoreanThinker avatar Sep 16 '21 15:09 KoreanThinker

@KoreanThinker unfortunately not. I had to switch to switch to notifee which in turn also have some similar cancelation bug 😂

andidev avatar Sep 16 '21 16:09 andidev

use cancelLocalNotifications({id: 1})

cynde avatar Sep 22 '21 14:09 cynde

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 23 '22 00:09 github-actions[bot]