mikaelbr / node-notifier

A Node.js module for sending notifications on native Mac, Windows and Linux (or Growl as fallback)
MIT License
5.72k stars 323 forks source link

Notification are always dismissed, even with MacOS setting for Alerts #407

Open k-funk opened 2 years ago

k-funk commented 2 years ago

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.

clementduncan commented 2 years ago

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
})
k-funk commented 2 years ago

Looks like that hack works. I'll just add

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

when i want it to stay up until dismissed.