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

Using 'appName' and 'actions', then actions did not show #426

Open
UnleashedMV opened this issue Jan 22, 2023 · 0 comments
Open

Using 'appName' and 'actions', then actions did not show #426

UnleashedMV opened this issue Jan 22, 2023 · 0 comments

Comments

@UnleashedMV
Copy link

UnleashedMV commented Jan 22, 2023

Hello everyone, I have the following problem.

When I set the 'appName' attribute, my action buttons are no longer displayed and I get an error when I click the notification.

But if I omit 'appName' my action buttons are displayed and I no longer get an error message when I click 'OK' or 'Cancle'.

const WindowsToaster = require('node-notifier').WindowsToaster;

Working config:
`

function showNotification() {

var notifier = new WindowsToaster({
    withFallback: true, // Fallback to Growl or Balloons? 
    customPath: void 0,// Relative path if you want to use your fork of toast.exe 
});

notifier.notify({
    title: "Notifier Action",
    message: "NewMessage",
    icon: ('C:\\projects\\POCs\\test-electron\\assets\\favicon.ico'),
    sound: true, // true | false. 
    wait: true, // Wait for User Action against Notification 
    actions: ['OK', 'Cancle'],
    // appName: 'Notifier'
}, (error, response) => {
    console.log(JSON.stringify({ error, response }, null, '\t'));
    if ('ok' === response) {
        shell.openExternal('http://google.com/');
    }
});

}

`

Not working config:
`

function showNotification() {

var notifier = new WindowsToaster({
    withFallback: true, // Fallback to Growl or Balloons? 
    customPath: void 0,// Relative path if you want to use your fork of toast.exe 
});


notifier.notify({
    title: "Notifier Action",
    message: "NewMessage",
    icon: ('C:\\projects\\POCs\\test-electron\\assets\\favicon.ico'),
    sound: true, // true | false. 
    wait: true, // Wait for User Action against Notification 
    actions: ['OK', 'Cancle'],
    // appName: 'Notifier'
}, (error, response) => {
    console.log(JSON.stringify({ error, response }, null, '\t'));

    if ('ok' === response) {
        shell.openExternal('http://google.com/');
    }
});

}

`

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

1 participant