Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

push notification javascript

function notifyMe(title,body) {
         if (Notification.permission !== 'granted'){
          Notification.requestPermission();
          alert('Allow Notification Please');
         }else {
          var notification = new Notification(title, {
           icon: '../assets/img/brand/logo.png',
           body: body,
           data: 'Nomad Chat',
           vibrate: [200, 100, 200]
          });
          notification.onclick = function() {
           window.open('chat.php');
          };
         }
        }
 
PREVIOUS NEXT
Tagged: #push #notification #javascript
ADD COMMENT
Topic
Name
6+4 =