【发布时间】:2019-09-18 06:41:45
【问题描述】:
我已经使用通知内容扩展实现了推送通知的自定义 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)
}
每当我单击“查看”按钮时,都会触发上述功能,但我需要从此处导航到特定屏幕。请帮忙。
提前致谢。
【问题讨论】:
-
你在使用故事板吗?
-
是的@Odwori,我正在使用情节提要。
标签: apple-push-notifications unnotificationscontentextension