Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use both - 'appID' and 'actions' parameters at the same time #326

Open
Denchijik opened this issue Apr 14, 2020 · 12 comments
Open

Can't use both - 'appID' and 'actions' parameters at the same time #326

Denchijik opened this issue Apr 14, 2020 · 12 comments

Comments

@Denchijik
Copy link

Denchijik commented Apr 14, 2020

Hi guys!
I was trying to make notifications with buttons on windows 10 (v1909) using this code:

notifier.notify( { title: 'title', message: 'message', icon: paths.appIconPath, actions: ['Close', 'Settings'], });

It worked, but I noticed that there is always a 'SnoreToast' message at the bottom of the notification. After some googling, I found that to hide this message I need to also provide an 'appID' parameter to the notify function. But when I provide it, the buttons disseaper. This code should possibly work, but it doesnt't:

notifier.notify( { title: 'title', message: 'message', icon: paths.appIconPath, actions: ['Close', 'Settings'], appID: 'SomeAppId' });

Am I missing something?

@amt-work
Copy link

@Denchijik I'm also having this issue.

@burasuk
Copy link

burasuk commented Jul 30, 2020

same here

@joydeep33
Copy link

@mikaelbr Is there any workaround for both the options to work?

@mikaelbr
Copy link
Owner

I no longer have easy access to Windows. Any help with debugging, implementation, and QA would be greatly appreciated. The source code is very straight (painfully so), so running it locally and debugging the issue should hopefully be very doable if you have this issue.

@aaron-legalweb
Copy link

I performed a little bit of initial investigation into this issue and it appears that data is not being returned over the pipe. None of the pipe's events actually fire when an appID is specified and a button is clicked. SnoreToast does however know the a button has been clicked and the exit code is correct.

@abjagtap
Copy link

abjagtap commented Aug 25, 2020

@mikaelbr facing the same issue. is there any workaround?

@GitGudAtCoding
Copy link

I tried running SnoreToast by itself (not through node-notifier) and it seems like using either textbox or buttons in conjunction with appID will cause the textbox or buttons to be missing. So it could be SnoreToast's issue, not node-notifier. :(

@Zytekaron
Copy link

Zytekaron commented Jan 14, 2021

SnoreToast requires you to register an application to make this work.
Here is a function you can try to use to register programs in Node.js, though it doesn't always work -- it will give you a command to use, though, that should. The process is described below.

cd node_modules\node-notifier\vendor\snoreToast
snoretoast-x86.exe -install "SnoreToast/<Program Name>.lnk" "" "AppName.UNIQUE_ID"

<Program Name> is the name you want to display in the notification instead of SnoreToast. Be sure to leave .lnk on the end.
The middle argument is for a program executable, but it can be left blank.
The last argument is the application id you will use later. The format is simply AppName.UNIQUE_ID.
This will create a program in your Start Menu -> SnoreToast folder, which will then allow you to use actions.

Remember to set the appID in the notifier to app id you used above instead of using the name of the app (example: { appID: "SomeApp.ID_HERE" })

@Araxeus
Copy link
Contributor

Araxeus commented May 8, 2021

For anyone facing the same issue:
see #332 (comment)

@Mansquatch
Copy link

When will this be fixed? Still seeing it in 10.0.1

@Araxeus
Copy link
Contributor

Araxeus commented Jun 26, 2022

There's an open PR with a fix (it's been more than a year since it was opened so I'm not hopeful that it will ever get merged)
KDE/snoretoast#15

We have fixed this issue in our app (youtube-music desktop) by applying a custom patch on top of the snoretoast binaries in node_modules

if you need some inspiration th-ch/youtube-music#600

(or if you want you could use the pre-compiled fixed binaries from viviedu@4d7e6ae)

@Araxeus
Copy link
Contributor

Araxeus commented Jan 7, 2023

There's actually a pretty easy way to fix this, we just didn't implement SnoreToast well enough:

Here's a guide: #424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests