UserNotifications 相关事件
UserNotifications related events
我正在使用 iOS 使用 UserNotifications 的应用程序。
当用户点击通知时,将触发此方法:
userNotificationCenter(_:didReceive:withCompletionHandler:)
我想知道是否有一个方法在通知到达时调用,与用户何时做出反应无关。
是的,你可以:https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/1649518-usernotificationcenter
当然,应用程序必须为此打开。如果应用程序关闭,您将无法执行代码。
在某些情况下,如果应用程序在后台但需要特殊授权,您可以执行代码。
我正在使用 iOS 使用 UserNotifications 的应用程序。
当用户点击通知时,将触发此方法:
userNotificationCenter(_:didReceive:withCompletionHandler:)
我想知道是否有一个方法在通知到达时调用,与用户何时做出反应无关。
是的,你可以:https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/1649518-usernotificationcenter 当然,应用程序必须为此打开。如果应用程序关闭,您将无法执行代码。 在某些情况下,如果应用程序在后台但需要特殊授权,您可以执行代码。