Lets a web page send notifications that are displayed outside the page at the system level. This lets web apps send information to a user even if the application is idle, in the background, switched tabs or moved to a different app.
http://ipanardian.github.io/browser-notif
// Request permission
// only need called once
browserNotif.requestPermission()
// Configuration
browserNotif.config({
icon: 'image.png',
dir: 'auto',
lang: 'en-US',
tag: 'myNotif',
})
// Notify
browserNotif.notify('First Notif', 'Today is your due date task!')
// with callback and onClick event
browserNotif.notify('First Notif', 'Indosystem Build Technology for The Better World', () => console.log('First Notif fired!'))
.onClick(() => window.open('https://www.indosystem.com'));
// override configuration
browserNotif.config({icon: 'loket.png'})
.notify('Second Notif', 'Your ticket booking will be expired in 5 minutes.', () => console.log('Second Notif fired!'))
.onClick(() => window.open('https://www.loket.com'));
// Create another instance
myNotif = Object.create(browserNotif)
bower install browser-notif
npm i browser-notif
The MIT License (MIT)