A push notification is a message that is “pushed” from backend server or application to user interface, e.g. (But not limited to) mobile applications and desktop applications. Service workers are a great way to run some script in the background and not putting the load on your main business logic running on front-end. Your app does not have to be open in the browser, to get the notification. It mean that’s the real purpose of push notifications, notify the user about the content of your application. A pplication server tells Google Cloud Messaging (GCM) server that there is something new content and GCM server then awakens the service worker which generates the push notification. Register Service Worker if ('serviceWorker' in navigator && 'PushManager' in window) { navigator.serviceWorker.register('software-worker.js') .then(function(reg) { registration = reg; ...
Comments
Post a Comment