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

node notifier not starting

Open lewatt23 opened this issue 6 years ago • 14 comments

Am been working on an alarm clock for a while now now i will like to use notifier to notify the user but can't fire node notifier in fact don't even know if the way am firing it is correct. Am using a windows 8.1 tried all the read me example but none works with me please to start if someone could tell what's wrong will be very grateful thanks Example of one of the way i tried to fire it after the declaration Notifier.notify({ 'message':'hello world '});

lewatt23 avatar Jul 20 '17 10:07 lewatt23

@lewatt23 Notifier.notify({ 'message':'hello world '});

for using this you should require node-notifier in variable named Notifier, otherwise it will not work. it is working perfectly for me, i am on windows 10.

AshishkrGoyal avatar Jul 28 '17 04:07 AshishkrGoyal

@AshishkrGoyal thanks for the replay . just to say i require it but not still working here is my code

const notifier = require('node-notifier'); const path = require('path');

notifier.notify({ title: 'My awesome title', message: 'Hello from node, Mr. User!', icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons) sound: true, // Only Notification Center or Windows Toasters wait: true // Wait with callback, until user action is taken against notification });

just tried the examples code as i said fbut not working

@AshishkrGoyal if the calling that i did is not correct please can u give me a sample code that will work . thanks in advance

lewatt23 avatar Jul 28 '17 09:07 lewatt23

Have you tried the current master branch? Does it work there? I wonder if this might be a appID backlash (#167 et. al)

mikaelbr avatar Aug 01 '17 09:08 mikaelbr

@lewatt23 you should use here JSON format for key and values, like

const notifier = require('node-notifier'); const path = require('path');

notifier.notify({ 'title': 'My awesome title', 'message': 'Hello from node, Mr. User!', 'icon': path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons) 'sound': true, // Only Notification Center or Windows Toasters 'wait': true // Wait with callback, until user action is taken against notification });

instead of

const notifier = require('node-notifier'); const path = require('path');

notifier.notify({ title: 'My awesome title', message: 'Hello from node, Mr. User!', icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons) sound: true, // Only Notification Center or Windows Toasters wait: true // Wait with callback, until user action is taken against notification });

this code.. hope it will work for you

cheers 👍

AshishkrGoyal avatar Sep 09 '17 08:09 AshishkrGoyal

@AshishkrGoyal Why do you think this does anything? Both syntaxes are equally valid JavaScript, and semantically makes no difference.

mikaelbr avatar Sep 09 '17 08:09 mikaelbr

@mikaelbr because JSON format works for me but simple JS formst does not work.

Thanks

AshishkrGoyal avatar Sep 09 '17 08:09 AshishkrGoyal

I think that is coincidental, I'm afraid. There might be something else that is also different between your examples (or some computer state that is different, calling two notifications in a row for instance). But I assure you. In JavaScript context there is no difference between

const obj = { 'foo': 1 };

and

const obj = { foo: 1 };

All keys in JavaScript objects are strings and are coerced to strings no matter what. For instance doing:

obj[1] = 'foo';

And 1 is still made into a string. Even if it looks like an int.

mikaelbr avatar Sep 09 '17 08:09 mikaelbr

Same problem here, on windows 8.1 as well - no notifications shown at all.

It seems whatever the issue is it's with SnoreToast.exe itself? here are a few tests running it manually:

W:\js\nodejs-server\node_modules\node-notifier\vendor\snoreToast>snoretoast -t t -m m -w
Installing shortcut: C:\Users\dc\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\SnoreToast.lnk W:\js\nodejs-server\node_modules\node-notifier\vendor\snoreToast\SnoreToast.exe Snore.DesktopToasts
^C

W:\js\nodejs-server\node_modules\node-notifier\vendor\snoreToast>snoretoast -t t -m m -w -appID Snore.DesktopToast
Notifications are disabled
Reason: DisabledForUser
Please make sure that the app id is set correctly.
Command Line: snoretoast  -t t -m m -w -appID Snore.DesktopToast

W:\js\nodejs-server\node_modules\node-notifier\vendor\snoreToast>snoretoast -t t -m m -w -appID SnoreToast
^C

Note that on all entered commands i'm using the -w (wait) flag...

On the first attempt it did install a shortcut, apparently with the appID "Snore.DesktopToasts", then i had to crtl+c since it did seems stuck...

Then i did ran the command again using the "Snore.DesktopToasts" appID, and the program did exit straight away telling DisabledForUser -- why? i do have notifications enabled, might be the appID...

On my Windows's Notifications settings i can see an "SnoreToast" app, so i tried to run the command again using that as the appID... and the command did hang, like trying to show the notification but being unable to... no idea what's going on here, but it's quite frustrating.

diegocr avatar Sep 09 '17 23:09 diegocr

I think this might been an issue related to appID and hopefully should be fixed in the latest version

mikaelbr avatar Jan 13 '18 12:01 mikaelbr

just gave version 5.2.1 a quick try on Win 8.1 and unfortunately it's the same, the notifications aren't shown.

diegocr avatar Feb 18 '18 05:02 diegocr

Am been working on an alarm clock for a while now now i will like to use notifier to notify the user but can't fire node notifier in fact don't even know if the way am firing it is correct. Am using a windows 8.1 tried all the read me example but none works with me please to start if someone could tell what's wrong will be very grateful thanks Example of one of the way i tried to fire it after the declaration Notifier.notify({ 'message':'hello world '});

Hey there! are you using Windows Ameliorated? I Believe they disabled notifications. Since i am also an ameliorated version user and i have the same issue.

Core-commits avatar Oct 24 '20 14:10 Core-commits

Any update on fixing this? I'm getting the issue on windows 8.1 just says "The toast encountered an error. Please make sure that the app id is set correctly."

lithin9 avatar Jan 15 '21 21:01 lithin9

I encountered this issue and found out it's because my win10 disabled app notification, just turn it on and fixed it, location is settings->通知和操作

reficull avatar Jan 25 '21 11:01 reficull

i got this snore toast malarkey when i wanted to so a simple npm run dev for my symfony website and i must say frameworks are turning into a bigger pain then they are worth with their multiple ways of installing shit and then even needing multiple dependencies from packages that never ever match up because group A for example is building a component and then you get errors like that the framework was expecting a version 1.10 or 1.12 or 1.14 of a component but github is already on version 1.15 so you get the error that its incompatible and then you have to install even more shit by hand to get even other things that is supposed to fix shit working that it cant because other shit has security vulnerabilities so it skips the depencencies on that shit because the versions don't match up And ALL I Actually want to do is Just Simply get CSS and Bootstrap working dangit

ghost avatar Jan 28 '21 19:01 ghost