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

Timeout not working on macOS #172

Open
Alxmerino opened this issue May 14, 2017 · 5 comments
Open

Timeout not working on macOS #172

Alxmerino opened this issue May 14, 2017 · 5 comments

Comments

@Alxmerino
Copy link

I'm trying to get a sticky notification by setting a really high timeout, see below, not matter if I set the wait prop or any number in the timeout the notification disappears after the same ~5s timeout.

new NotificationCenter({withFallback: false}).notify({
        title: 'Hello',
        subtitle: 'world!',
        message: `FooBar message`,
        sound: 'Ping',
        timeout: 60,
        wait: true,
    }, (err, response) => {
        console.log('ERR', err);
        console.log('RESPONSE', response);
    });

Any help with this would be appreciated
Thanks!

@qiangzi7723
Copy link

@Alxmerino

I have the same problem when I use timeout.

Maybe we could loop the notify and use a setTimeout function

notifier.notify({
  'title': 'My notification',
  'message': 'Hello, there!',
  'wait': true,
});

notifier.on('timeout', function (notifierObject, options) {
  notifier.notify({
    'title': 'My notification',
    'message': 'Hello, there!',
    'wait': true,
  });
});

@janolivermr
Copy link

To everyone looking for help with this, it appears that banner messages do not allow persistence. If you enter the System Preferences -> Notifications and change Terminal Notifier Notifications from Banners to Alerts, they will persist. This only works with timeout though, not with wait: true, but it's a start. It's noteworthy that this still throws an error after some time, so if you have an action on a button that should be processed after clicking the button 2 minutes after the message was shown, this is likely not going to work. This issue is most likely to be solved in the terminal-notifier project

@kevinelliott
Copy link

@janolivermr Looks like terminal-notifier was last updated in Nov 1, 2017 and removed the timeout functionality (amongst other things). I don't expect we'll see a fix.

Any other solution for us?

@comatory
Copy link

I'm still having these issues on macos Monterey

@lnfel
Copy link

lnfel commented Mar 18, 2023

timeout is now available as time, the following notification closes within 10 seconds when Terminal notifier is set to Alerts in MacOS.

nodeNotifier.notify({
    title: "Hey",
    message: "Wake up!",
    sound: true,
    time: 10000
}, (error, response, metadata) => {
    console.log('notifier error: ', error)
    console.log('notifier response: ', response)
    console.log('notifier metadata: ', metadata)
})

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

6 participants