如何在 WatchOS 2.0 中实现通知处理程序?

How to implement notification handler in WatchOS 2.0?

handleActionWithIdentifier:forLocalNotification:'s docs 中声明此方法已弃用 来自 WatchOS 2.0

我在 Notification section, they suggest using UNUserNotificationCenter of UserNotifications 框架中寻找 App Programming Guide for watchOS。但是这个框架 需要 WatchOS >= 3.0

我的应用程序如何适配 WatchOS 2.0 用户?

对于 WatchOS 2.0,您必须实施已弃用的方法 handleActionWithIdentifier:forLocalNotification:。随着 UserNotifications 框架的引入,该方法已被弃用。由于此框架在 3.0 之前的 WatchOS 上不可用,因此不推荐使用的方法是旧版本的方法。