UNNotificationActions

Working on Local notifications with Custom Actions. The notification shows on my iPhone and includes all 3 custom actions assigned to the Category.


When my iPhone is locked, the notification arrives on my Apple Watch, but the Custom Actions are not there - just the Dismiss button.


Any idea what's going on here?


Here's a code sample


let actionLess = UNNotificationAction(identifier: "LESS",
  title: "Less",
  options: [.foreground])
let actionMore = UNNotificationAction(identifier: "MORE",
  title: "More",
  options: [.foreground])
let action90 = UNNotificationAction(identifier: "90",
  title: "90min",
  options: [.foreground])
let category = UNNotificationCategory(identifier: "SLEEP4B",
  actions: [actionLess, action90, actionMore],
  intentIdentifiers: [],
  options: .customDismissAction)
UNUserNotificationCenter.current().setNotificationCategories([category])


func userNotificationCenter(_ center: UNUserNotificationCenter,
  willPresent notification: UNNotification,
  withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {

  completionHandler([.alert, .sound, .badge])

}
UNNotificationActions
 
 
Q