收到通知但未点击或解除通知时通知申请

时间:2016-12-20 16:27:30

标签: ios swift

在iOS 10上,是否有任何代表通知应用程序没有点击通知或取消通知?

我的意思是,即使用户没有点击通知数据,如何获取通知数据?

我有两个委托方法只有在用户点击通知时才会响应:

func userNotificationCenter(_ center: UNUserNotificationCenter,  willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (_ options:   UNNotificationPresentationOptions) -> Void) {}

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {}

1 个答案:

答案 0 :(得分:0)

当通知到达时,将调用以下方法。

func didReceive(_ notification: UNNotification)

请参阅此Apple doc以获取更多信息。 Notifications apple

相关问题