我已注册UIMutableUserNotificationAction
:
let responseTextAction = UIMutableUserNotificationAction()
responseTextAction.identifier = "text"
responseTextAction.title = "New text"
if #available(iOS 9.0, *) {
responseTextAction.behavior = UIUserNotificationActionBehavior.TextInput
} else {
// Fallback on earlier versions
}
这是来自iOS 9的截图:
来自iOS 8:
如何实现iOS 8的文本输入。
答案 0 :(得分:1)
通知的文本输入仅适用于iOS 9+。如您所见,以前的版本将默认为标准通知。