在“监视”应用中注册可操作通知



我正在我的手表应用程序中实现可操作的通知。我已经定义了我的通知有效负载,但我在通知中没有收到可操作的按钮。根据苹果文档

Action buttons save time for the user by offering some standard responses for a notification. Apple Watch makes use of the interactive notifications registered by your iOS app to display action buttons. In iOS 8 and later, apps are required to register the types of notification-generated alerts they display using a UIUserNotificationSettings object. When registering that information, the app can also register a set of custom notification categories, which include the actions that can be performed for that category. Apple Watch uses this category information to add the corresponding action buttons to the long-look interface. 

我有一个简单的问题,即使您在有效负载文件中定义了操作,是否也必须注册可操作的通知?

您需要

在代码中设置用户通知设置和用户通知操作。通过此链接

相关内容

最新更新