首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >windows中的粘滞通知不起作用

windows中的粘滞通知不起作用
EN

Stack Overflow用户
提问于 2019-02-13 16:14:31
回答 1查看 223关注 0票数 1

node-notifier是否支持让通知停留在动作中心,直到用户解除通知?超时和等待属性当前不起作用

EN

回答 1

Stack Overflow用户

发布于 2021-02-13 14:22:42

这取决于操作系统。对于mac,它提供超时和等待,但对于windows,它不被windows支持。

以下是所有通知选项:

代码语言:javascript
复制
const NotificationCenter = require('node-notifier').NotificationCenter;

var notifier = new NotificationCenter({
  withFallback: false, // Use Growl Fallback if <= 10.8
  customPath: undefined // Relative/Absolute path to binary if you want to use your own fork of terminal-notifier
});

notifier.notify(
  {
    title: title,
    subtitle: subtitle,
    message: message,
    sound: false, // Case Sensitive string for location of sound file, or use one of macOS' native sounds (see below)
    icon: 'Terminal Icon', // Absolute Path to Triggering Icon
    contentImage: undefined, // Absolute Path to Attached Image (Content Image)
    open: undefined, // URL to open on Click
    wait: false, // Wait for User Action against Notification or times out. Same as timeout = 5 seconds

    // New in latest version. See `example/macInput.js` for usage
    timeout: 5, // Takes precedence over wait if both are defined.
    closeLabel: undefined, // String. Label for cancel button
    actions: undefined, // String | Array<String>. Action label or list of labels in case of dropdown
    dropdownLabel: undefined, // String. Label to be used if multiple actions
    reply: false // Boolean. If notification should take input. Value passed as third argument in callback and event emitter.
  },
  function (error, response, metadata) {
    console.log(response, metadata);
  }
);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54665371

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档