How to remove all scheduled notifications



I have settled up several daily notifications, and wanna cancel them now. Which function can I use? I try to run bellow script but only got a ‘TypeError:notif.removeAllPending is not a function’.

let notif = new Notification()


Try this.

console.log(await Notification.allPending());
await Notification.removeAllPending();
console.log(await Notification.allPending());

It should list the pending notifications, then remove them and then display that they have been removed. The middle line is the key one for your code above.


It works! All pending notifications have removed.
Thanks, man.