summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/sdk/notification.js
blob: 1ca85e749c63bd93f2b4cd03e1abee875b73a83e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sdk.notification = (function(){

  var notification = {}

  notification.request = (cb) => {
    Notification.requestPermission().then(function(permission) {
      if (permission === "granted") {

      }
    })
  }

  notification.notify = (msg) => {
    if (Notification.permission === "granted") {
      var n = new Notification(msg);
    } else if (Notification.permission !== 'denied') {
      notification.request(() => {
        notification.notify(msg)
      })
    }
  }

  return notification
})()