question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cancelLocalNotification does not cancel a notification with tag

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
Dallas62commented, Sep 10, 2021

Hi @andidev

For delivered notification, you can use:

PushNotification. clearNotification(tag, id);

Regards

0reactions
github-actions[bot]commented, Sep 23, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cancelAllLocalNotifications not cl… | Apple Developer Forums
cancelLocalNotification seems to cancel the notification because [[UIApplication sharedApplication] scheduledLocalNotifications] count goes to 0, but iOS re- ...
Read more >
how to cancel a localNotification with the press of a button in ...
You can cancel a notification using its identifier : let center = UNUserNotificationCenter.
Read more >
How to Read and Cancel Local Notification Requests
In this tutorial, you will learn how to read and cancel local user notification request(UNNotificationRequest) or how to remove the pending ...
Read more >
NotificationManager - Android Developers
This is also the same tag and id you pass to the cancel(int) or cancel(java.lang. ... A notification with no importance: does not...
Read more >
react-native-push-notification - npm
timeoutAfter: null, // (optional) Specifies a duration in milliseconds after which this notification should be canceled, if it is not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found