show NSUserNotification additionalActions on click

倾然丶 夕夏残阳落幕 提交于 2019-12-03 15:17:04

While trying to find a solution for the same problem I found this nice explanation for the NSUserNotificationPrivate class that explains how the Reminders app does it.

https://github.com/indragiek/NSUserNotificationPrivate

If the notification type is set to "Alert", the alternateActionButtonTitles property lets you set an array of additional menu item titles to be shown in an action menu that can be accessed by hovering on the Action button and clicking on the arrow.

Once a notification is handled, the index of the action can be retrieved using the _alternateActionIndex property.

So they are using a private API. As the site's disclaimer say using any of this will result in your app being rejected from the MAS and potentially breaking if the APIs change.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!