KenL
KenL

Reputation: 101

How to increase the notification time

I have tried using the notification property of priority to increase the notification time but failed to do so. Please advise.

Following is the sample code.

chrome.notifications.create(
  "testing",
  {
    type: "basic",
    icon: "icon.png",
    title: "Test",
    message: "Hellow Word!"
  },
  function(){
    setTimeout(function(){
      chrome.notifications.update("testing", {priority: 1}, function(){});
    }, 5000);
  }
);

Upvotes: 0

Views: 450

Answers (2)

abhishek Sharma
abhishek Sharma

Reputation: 140

you need to set the timings in Testing section where the function is getting called.

Upvotes: -1

jek
jek

Reputation: 148

In Chrome 50 you can now use requireInteraction which i found here.

Indicates that the notification should remain visible on screen until the user activates or dismisses the notification.

Upvotes: 2

Related Questions