Add notification sending functionality.

This commit is contained in:
2018-12-12 00:03:17 -08:00
parent 00ba3a6ac0
commit 3e7d12b6e4
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
if("Notification" in window) {
Notification.requestPermission();
}
function setupNotificationPorts(app) {
app.ports.sendNotificationPort.subscribe(function(data) {
var options = {
"body" : data.text
}
new Notification(data.name, options)
})
}