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

It's not possible to wait user interaction #60

Closed alfeltrin closed 5 years ago

alfeltrin commented 5 years ago

The 'timeout' parameter should have a value (for ex. 0) to keep the notification open till the user don't interact

georgeOsdDev commented 5 years ago

You can use requireInteraction option. https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification

And we need skip to call setTimeout when props.timeout <= 0 https://github.com/mobilusoss/react-web-notification/blob/master/src/components/Notification.js#L113

georgeOsdDev commented 5 years ago

v0.7.0 is available now. https://github.com/mobilusoss/react-web-notification/releases/tag/v0.7.0

dev-cyberange commented 5 years ago

The requireInteraction isn't working properly on firefox in linux. It's getting closed automatically after a few seconds even if the timeout is set to 0. It's working properly on chrome.

georgeOsdDev commented 5 years ago

It seems to be not a matter of this library, but for Firefox. https://bugzilla.mozilla.org/show_bug.cgi?id=862395