NotificationAction Object
typestring -The type of action, can be动作的类型,可以是button.button。textstring (optional) -The label for the given action.给定操作的标签。
Platform / Action Support平台/操作支持
| Action Type | texttext的用法 | text | ||
|---|---|---|---|---|
button | macOS | "Show"button, otherwise empty)button,则系统默认为本地化字符串,否则为空) | hasReply and will be ignored if hasReply is true.hasReply不兼容,如果hasReply为true,则将被忽略。 |
Button support on macOSmacOS上的按钮支持
In order for extra notification buttons to work on macOS your app must meet the following criteria.为了让额外的通知按钮在macOS上工作,您的应用程序必须满足以下标准。
- App is signed
App has it's应用程序在NSUserNotificationAlertStyleset toalertin theInfo.plist.Infoplist中将其NSUserNotificationAlertStyle设置为alert。
If either of these requirements are not met the button won't appear.如果这两个要求中的任何一个都不满足,按钮将不会出现。