electron/docs/api/structures/notification-action.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
1 KiB
Markdown
Raw Normal View History

# NotificationAction Object
* `type` string - The type of action, can be `button`.
* `text` string (optional) - The label for the given action.
## Platform / Action Support
2017-06-23 11:04:39 +00:00
| Action Type | Platform Support | Usage of `text` | Default `text` | Limitations |
2017-06-23 14:30:13 +00:00
|-------------|------------------|-----------------|----------------|-------------|
2018-01-17 05:18:26 +00:00
| `button` | macOS | Used as the label for the button | "Show" (or a localized string by system default if first of such `button`, otherwise empty) | Only the first one is used. If multiple are provided, those beyond the first will be listed as additional actions (displayed when mouse active over the action button). Any such action also is incompatible with `hasReply` and will be ignored if `hasReply` is `true`. |
### Button support on macOS
In order for extra notification buttons to work on macOS your app must meet the
following criteria.
* App is signed
2018-01-16 09:36:42 +00:00
* App has it's `NSUserNotificationAlertStyle` set to `alert` in the `Info.plist`.
If either of these requirements are not met the button won't appear.