简体   繁体   English

收到通知但未点击或关闭通知时通知申请

[英]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.

相关问题 如何在接收和点击推送通知时显示特定的UIViewController - How to display a specific UIViewController when a push notification is received and tapped 你能检测到 UIViewController 何时被解除或弹出吗? - Can you detect when a UIViewController has been dismissed or popped? 模态视图控制器被关闭后如何调用函数 - How to call a function when a Modal View Controller has been dismissed 取消iOS模态时的RN回调 - RN callback when a Modal has been dismissed for iOS iOS - 了解模态视图何时被解除 - iOS - Know when modal view has been dismissed 如何检测何时关闭iAd? - How can I detect when an iAd has been dismissed? 自定义标注在MKMapView中被点击时被关闭 - Custom callout getting dismissed in MKMapView when tapped 用户在后台收到推送后手动打开应用程序时获取推送通知有效负载 - Getting push notification payload when user opens app manually after push has been received in the background 以“全屏”视图显示图像-轻按图像视图后 - Display image in a “fullscreen” view - when image view has been tapped 在 iPhone 上收到通知时会触发哪种方法(不是在点击并打开通知后)? - Which method will be triggered when the notification received on iPhone(not after the notification is tapped and opened)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM