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

Can not listen to the event when set appID #408

Closed truongnat closed 2 years ago

truongnat commented 2 years ago

On window.

Before starting, set actions for it.

notifier.notify({
  title: 'My notification',
  message: 'Hello, there!',
  actions: ["ok","cancel"]
});

notifier.on('ok', function (notifierObject, options, event) {
  // Triggers click ok
});

notifier.on('cancel', function (notifierObject, options, event) {
  // Triggers click cancel
});

Case 1: appID = undefined => node-notifier is displayed and listen event work

Case 2: appID = my.app.id => node-notifier is displayed and it display is in my app group

In my case, I want to set appID = my App ID to show my app group and listen to event work.

note: I have read the source code of node-notifier:

It passes property to SnoreToast.exe and executes it. If set appID for it, Emit Event will not work, I think so.

You can see source here: https://github.com/mikaelbr/node-notifier/blob/master/notifiers/toaster.js

If anyone have solution, plz help me. Thanks all

santosh898 commented 2 years ago

Hi @truongnat. I am having the same problem. Since you closed the issue i wanted to ask if you resolved this?

truongnat commented 2 years ago

@santosh898 I have resolved it.

santosh898 commented 2 years ago

Thank you