Duration of Notification

1

I'm using the Notification API, but I'm not finding a way to leave the message open until it's clicked or closed by the user. I noticed that Google Hangouts does this, the notification stays there until it's clicked. Does anyone have any ideas? I'm currently doing this:

var detalhe = {
   body: msg,
   icon: 'icone.png',
};
notificacao = new Notification('Teste', detalhe);

Thanks for the help.

    
asked by anonymous 11.11.2016 / 10:00

1 answer

1

According to documentation you should optionally use the requireInteraction , which will receive a Boolean value.

var detalhe = {
    body: msg,
    icon: 'icone.png',
    requireInteraction: true
};

This should help you!

    
11.11.2016 / 11:35