sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 513 forks source link

kepp desktop notification until user close it #306

Closed dsmarques closed 6 years ago

dsmarques commented 7 years ago

Dear Sirs, I'm using desktop pnotify in my application. This is the code:

PNotify.desktop.permission(); new PNotify({

text: 'Existe um pedido novo gravação! \n'+ m_grava,
buttons:{
closer: true
    },
desktop: {
   icon: '../_lib/img/gip_logoaz2.png', 
    desktop: true,
    title: 'GRAVAÇÃO'

},
hide:false

}); I want to keep the notification visible until user close it. according to your documentation this will be possible with the parameter hide:false. But, I do not know why, the notification disappears after few seconds. Any tip on how to solve this issue?

Regards, David

todduk commented 7 years ago

I believe it depends on the implementation of desktop notifications by the browser developers. Firefox has a set limit of time that a notification can be displayed for, probably to prevent abuse. This is mentioned on the site unless I'm mistaken.

EDIT: It's alluded to in the popup in the documentation page, but it's mentioned explicitly on caniuse, I just tested with Chrome and even sticky notifications disappear after a few seconds.

hperrin commented 6 years ago

Yeah, unfortunately, this is a browser limitation.