Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js desktop notification

 notify(message = '', title = '', logoUrl, redirectUrl) {
    Notification.requestPermission().then((result) => {
      console.log(result);
      const notification = new Notification(title, {
        icon: logoUrl,
        body: message,
      });
      notification.onclick = () => {
        window.open(redirectUrl);
      };
    });
  }
 
PREVIOUS NEXT
Tagged: #js #desktop #notification
ADD COMMENT
Topic
Name
9+8 =