我已经使用通知内容扩展实现了推送通知的自定义 UI。我添加了一个“查看”操作,如下所示
let navigateAction = UNNotificationAction(identifier: "ActionNotification", title: "View", options: [])
let deafultCategory = UNNotificationCategory(identifier:
"myNotifService", actions: [navigateAction], intentIdentifiers:[], options: [])
现在,在 Content Extension 的类 - NotificationViewController
func didReceive(_ response: UNNotificationResponse, completionHandler completion:(UNNotificationContentExtensionResponseOption) -> Void) {
if response.actionIdentifier == "ActionNotification" {
// HERE I NEED TO NAVIGATE TO SPECIFIC VIEW CONTROLLER
}
completion(.dismiss)
}
每当我单击“查看”按钮时,都会触发上述功能,但我需要从此处导航到特定屏幕。请帮忙。
提前致谢。