Receive push notifications through Service workers seem pretty straightforward
self.addEventListener('push', function(event) {
var obj = event.data.json();
if(obj.action === 'subscribe' || obj.action === 'unsubscribe') {
fireNotification(obj, event);
port.postMessage(obj);
} else if(obj.action === 'init' || obj.action === 'chatMsg') {
port.postMessage(obj);
}
});
`
but, I'm still wondering which tools I need to create my own hosted notification service. I was thinking in a stack based on node.js, express, etc etc ..
j
stuff ;)
you could use socket.io which takes a lot of overhead away. you could use zeroMQ or any other queue system to use complex pub sub systems.
You could as well implement your own socket system which is fun too. I guess you should invite the javascript guys (link on the right side) to get a idiomatic answer :)