of something creative ! self.addEventListener('install', function(event) { console.log('Hi There !'); }); JS PS : I we don’t listen to the event, it will do nothing, simply pass it to the next one, then to the next one until the Pipe line got filled !
messaging = firebase.messaging(); messaging.onMessage((notif) => { console.log(notif); let dialog = document.querySelector('dialog'); if (!dialog.showModal) { dialogPolyfill.registerDialog(dialog); } document.getElementById('message').innerHTML = notif.notification.body; document.getElementById('title').innerHTML = notif.notification.title; dialog.showModal(); dialog.querySelector('.close').addEventListener('click', () => { dialog.close(); }); }); JS Showing a Local model on Notification While Being on Page UX is different while being on page
Notifications! { “name” : “Application Name”, “gcm-sender_id” : “103953800507” } JSON PS : Add the code above to the manifest.json file (will get there in seconds ;))