Пользовательский интерфейс уведомлений - PullRequest
0 голосов
/ 13 марта 2019

Я работаю над пользовательским интерфейсом удаленной настройки, в который хочу добавить 4 UNNotificationAction. Я сделал с реализацией, и она отлично работает на всех устройствах, кроме iPhone 5 . На iPhone 5 отображаются только первые 2 действия и действие «Очистить», которое используется по умолчанию.

А также код внутри моего Content Extension и Service Extension не вызывается на iPhone 5.

Ниже приведен фрагмент кода.

func setCategories(){
        //Actions
        let remindLaterAction = UNNotificationAction(identifier: "remindLater", title: "Remind me later", options: UNNotificationActionOptions(rawValue: 0))
        let acceptAction = UNNotificationAction(identifier: "accept", title: "Accept", options: .foreground)
        let declineAction = UNNotificationAction(identifier: "decline", title: "Decline", options: .destructive)
        let commentAction = UNTextInputNotificationAction(identifier: "comment", title: "Comment", options: .authenticationRequired, textInputButtonTitle: "Send", textInputPlaceholder: "Share your thoughts..")

        //Category
        let invitationCategory = UNNotificationCategory(identifier: "alarm.category", actions: [remindLaterAction, acceptAction, declineAction, commentAction], intentIdentifiers: [], options: UNNotificationCategoryOptions(rawValue: 0))

        //Register the app’s notification types and the custom actions that they support.
        UNUserNotificationCenter.current().setNotificationCategories([invitationCategory])
    }

Это связано с устройством или ОС, пожалуйста, предложите.

...