[英]Notify application when a notification has been received and not tapped on or dismissed
On iOS 10, is there any delegate to notify application that notification was not tapped on or it was cancelled? 在iOS 10上,是否有任何代表通知应用程序未点击通知或通知已取消?
I mean, how to get notification data even if the user has not tapped on it? 我的意思是,即使用户未点击也如何获取通知数据?
I have those two delegate methods which respond only when the user taps the notification: 我有这两个委托方法,它们仅在用户点击通知时才响应:
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (_ options: UNNotificationPresentationOptions) -> Void) {}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {}
Below method will be called when notification arrives. 通知到达时,将调用以下方法。
func didReceive(_ notification: UNNotification)
see this apple doc for further information. 有关更多信息,请参阅此苹果文档。 Notifications apple 通知苹果
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.