mobilusoss / react-web-notification

React component with HTML5 Web Notification API
http://mobilusoss.github.io/react-web-notification
MIT License
270 stars 80 forks source link

Modern browsers support #66

Closed sashuk closed 4 years ago

sashuk commented 4 years ago

The routine that asks for permissions is expecting the requestPermission() to accept callback. However, according to the documentation at https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission the newer standard is returning the Promise.

  window.Notification.requestPermission(function (permission) {
    var result = permission === PERMISSION_GRANTED;
    ...
  });

Thanks a lot for the library!

georgeOsdDev commented 4 years ago

I published v0.8.0 on NPM https://www.npmjs.com/package/react-web-notification