NotificationAction Object
type
string -The type of action, can be动作的类型,可以是button
.button
。text
string (optional) -The label for the given action.给定操作的标签。
Platform / Action Support平台/操作支持
Action Type | text text 的用法 | 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应用程序在NSUserNotificationAlertStyle
set toalert
in theInfo.plist
.Infoplist
中将其NSUserNotificationAlertStyle
设置为alert
。
If either of these requirements are not met the button won't appear.如果这两个要求中的任何一个都不满足,按钮将不会出现。