js desktop notification

Solutions on MaxInterview for js desktop notification by the best coders in the world

showing results for - "js desktop notification"
Tom
02 Jan 2017
1 notify(message = '', title = '', logoUrl, redirectUrl) {
2    Notification.requestPermission().then((result) => {
3      console.log(result);
4      const notification = new Notification(title, {
5        icon: logoUrl,
6        body: message,
7      });
8      notification.onclick = () => {
9        window.open(redirectUrl);
10      };
11    });
12  }