node-notifier icon indicating copy to clipboard operation
node-notifier copied to clipboard

Notification are always dismissed, even with MacOS setting for Alerts

Open k-funk opened this issue 2 years ago • 2 comments

OS: MacOS 12.3.1 Node: v17.7.1

Is there a setting to make the notification persist? My notification always appear as "Banners" even though I've selected "Alerts" in the OS settings: Screen Shot 2022-04-16 at 14 34 34

    notifier.notify({
      title: message,
      message: JSON.stringify(data),
      sound: true,
    })

Similarly, but possibly unrelated: The notifications don't show up in my Mac's Notification Center, the way my WhatsApp, Slack, etc messages do.

k-funk avatar Apr 16 '22 20:04 k-funk

Try adding a 'timeout' value. When Notification Centre is on 'Banners', the 'timeout' is ignore, but used when it's set to 'Alerts'

notifier.notify({
  title: message,
  message: JSON.stringify(data),
  sound: true,
  timeout: 30
})

clementduncan avatar Aug 10 '22 11:08 clementduncan

Looks like that hack works. I'll just add

notifier.notify({
  ...
  timeout: 99999999999,
})

when i want it to stay up until dismissed.

k-funk avatar Aug 13 '22 14:08 k-funk