chrome notification does not appear

0

Good evening, I'm running a code to submit a notification:

if(Notification.permission === 'granted' && !this._active) {
    let n = new Notification(this._activeContact.name,{
       icon : this._activeContact.photo,
       body : data.content
    });

But no notification is popping up! What could be happening?

Permission is already positive

***** edited ****

The code that asks for the permission is this: alias, is not working on the edge ...

checkNotifications(){
    // debugger
    if (typeof Notification === 'function'){
        if (Notification.permission !== 'granted'){
            this.el.alertNotificationPermission.show()
        } else {
            this.el.alertNotificationPermission.hide()
        }

        this.el.alertNotificationPermission.on('click', e=> {
            Notification.requestPermission(permission => {
                if (permission === 'granted') {
                    this.el.alertNotificationPermission.hide()
                    console.info('notificações permitidas!')
                }
            })
        })
    }
}
    
asked by anonymous 05.11.2018 / 23:48

1 answer

0

Have you ever tried to call him using requestPermission ?

Notification.requestPermission()
    
06.11.2018 / 00:25