2

After updating Google chrome to version 75 the desktop notification stopped working, but it is working fine on Firefox, is there a way to fix this issue or any workaround to display the desktop notification? Thanks in advance. Note the application is web application not chrome extension, below is a sample for the desktop notification

Notification.requestPermission();
new Notification ("Desktop notification example")
  • 1
    check following post: https://stackoverflow.com/questions/2271156/chrome-desktop-notification-example there might be some methods that will work for you! – Patrick Lüthi Jul 08 '19 at 09:56

1 Answers1

2

The new Notification spec is updated. You need to change it to a promise based syntax for notifications now. Code should be something like this:

Notification.requestPermission().then(function(permission) { 
   if(permission === 'granted') {
      new Notification ("Desktop notification example")
   } else {
      console.log('not granted')
   }

})

New specification is written here

Shababb Karim
  • 3,614
  • 1
  • 22
  • 35