Duration of the Notification

Asked

Viewed 20 times

1

I’m using the Notification API, but I can’t find a way to leave the message open until it’s clicked or closed by the user. I realized that Google Hangouts does this, the notification stays there until it is clicked. Anybody got any ideas? Currently I’m doing so:

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

Thanks for the help.

  • Can you [Edit] the question and give an example with the code you have working? like a jsFiddle...

1 answer

1


According to the documentation you should use the property as an option requireInteraction, you will receive a boolean value.

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

That should help you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.