Reputation: 3439
I'm using Notification API to show desktop notifications to user. The specification says that the notification will be dismissed after 4 seconds automatically. I was expecting that this can be controlled by Notification settings on respective platforms. For eg. The notification display duration can be controlled using accessibility feature on Windows 10. Another option listed in the specification is the requireInteraction
flag (Firefox requires this to be enabled from about:config
). However, none of these helped and notification still gets dismissed in approximately 4 seconds. Does anyone know a way to keep this notification longer than 4 seconds? Our clients are complaining that they miss notifications and dont realize that there is something in the list for them act on.
The notification I'm referring here is Notification on Chrome/Firefox for desktop browsers.
Upvotes: 3
Views: 2471
Reputation: 3439
Finally I got it working. It appears that behaviour is different on different OS.
requireInteraction: true
would indeed add a close
button to notifications on windows and stay until user dismisses it manually. For other cases, duration can be increased by changing the settings in Ease of access->Display->Show notifications for
. User can set how long these notifications should stay. I also noticed, multiple notifications raised will come only one after another if requireInteraction
flag is set, which means, second notification will be shown when user dismisses the first one. It will be better for the application to clear all notifications once the window comes to foreground.Settings->Notification
) for Chrome to be alerts
if you prefer to dismiss them manually. banners
type will disappear after 4 seconds. Upvotes: 3