当用户单击UNNotificationAction时,在锁定屏幕上显示操作表

问题描述

我正在处理丰富的推送通知。有一个标识符为“ message”的UNNotificationCategory,带有3个UNNotificationAction(回复快速回复,viewMessage)。当用户拉出推送通知时,所有这些操作都将作为操作表出现。如果用户单击快速回复,则需要显示带有4个快速选项的操作表。有什么办法可以做到这一点? 以下是我需要的行为的屏幕截图。

When user stretch the push

When user click on quick reply

下面是类别注册代码

 let quickReplyAction = UNNotificationAction(identifier:MessageCategory.Action.quickReply.identifier,title: NSLocalizedString("CategoryAction.Message.QuickReplies",value: "Quick Replies",comment: ""),options: [])

    let viewMessageAction = UNNotificationAction(identifier: MessageCategory.Action.viewMessage.identifier,title: NSLocalizedString("CategoryAction.Message.ViewMessage",value: "View Message",options: [.foreground])

    let messageCategory = UNNotificationCategory(identifier: MessageCategory.identifier,actions: [replyAction,quickReplyAction,viewMessageAction],intentIdentifiers: [],options: [])

    UNUserNotificationCenter.current().setNotificationCategories([messageCategory,debitOverdraftNotifCategory])

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)