How to remove all scheduled notifications

question

#1

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()
notif.removeAllPending()

#2

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.


#3

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