【问题标题】:how to add textfield in iOS interactive notification如何在 iOS 交互式通知中添加文本字段
【发布时间】:2015-11-04 08:38:30
【问题描述】:

我想像 imessage 一样开发交互式通知。我阅读了文档,并尝试将多个 UIMutableUserNotificationAction 添加到 UIMutableUserNotificationCategory 并显示它。我想像 iMessage 一样显示文本字段。这是我的问题

UIMutableUserNotificationCategory *notificationCategory = [[UIMutableUserNotificationCategory alloc] init];
notificationCategory.identifier = @"Email";
[notificationCategory setActions:@[notificationAction1,notificationAction2,notificationAction3] forContext:UIUserNotificationActionContextDefault];
[notificationCategory setActions:@[notificationAction1,notificationAction2] forContext:UIUserNotificationActionContextMinimal];

请帮忙

【问题讨论】:

标签: ios ios8 notifications ios9 uilocalnotification


【解决方案1】:
let replyAction = UIMutableUserNotificationAction()
replyAction.identifier = "REPLY_ACTION"
replyAction.title = "Reply"
replyAction.activationMode = UIUserNotificationActivationMode.Background
replyAction.authenticationRequired = false    
replyAction.destructive = false
//Set behaviour to .TextInput    
replyAction.behavior = .TextInput

【讨论】:

    猜你喜欢
    • 2014-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多