0

I want to show a web notification indefinitely in javascript, i have tried to set the requireInteraction flag in the notificaiton options, but without luck. It is a big requirement that the notification stay on the screen in win 10 for ever and don't close after a time.

notificationOptions = {
                body: messageText,
                icon: iconURL,
                renotify: true,
                requireInteraction : true,
                tag: 'NotReadyStateChange1'
            };
PtAuHg
  • 1
  • 3
  • *"but without luck"* What happens? Does the notification appear but then go away? After how long? Is it consistent across browsers and OSes? – T.J. Crowder Sep 03 '20 at 07:18
  • the notification appear and then disappear from the screen after a random time, sometimes it will stay for 6 minutes and sometimes 13 minutes. I have tried in edge, chrome and firefox and the notification stays the longest in chrome. and it has to be in windows 10 – PtAuHg Sep 03 '20 at 07:19
  • i use the standard javascript notification. i have just edited the question to use the config i actually use in the code – PtAuHg Sep 03 '20 at 07:26
  • 1
    @T.J.Crowder I saw that later, I ALSO saw many answers in the duplicate that gave more information and workarounds. I can re-open – mplungjan Sep 03 '20 at 07:37
  • 1
    Perhaps there are more information in this [question](https://stackoverflow.com/questions/20326926/prevent-chrome-notifications-api-from-hiding-my-notification-after-a-few-seconds) – mplungjan Sep 03 '20 at 07:37
  • @mplungjan i am fairly new to javascript, and the question you linked to is for chrome browser action, how can i implement that in standard javascript, i cant rely on chrome because i am developing a cisco finesse gadget, so it is not running in a seperate web browser – PtAuHg Sep 04 '20 at 07:17
  • If it supports notification interface it should also handle the requireInteraction: true - if not then it is not supporting the full interface... Then perhaps the notification interface is not for your application – mplungjan Sep 04 '20 at 07:21
  • i have just discovered that it just hide the on screen notification, if i get another notification from for example an email then the notification shows on screen again. do you have another notification interface i could try? – PtAuHg Sep 04 '20 at 07:30
  • Sorry, no. I do not use the notification interface and I do not know your cisco finesse gadget, – mplungjan Sep 04 '20 at 07:40

0 Answers0