我在很多天(20 posts+)中做了很多搜索,但是我没有解决我的问题。
我有一个接收推送通知的应用程序,我可以接收那些远程通知,但是当我点击它时,不调用委托"didReceiveRemoteNotification“(我想拦截有效负载来执行它的操作)。
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
print("test")
}提前,谢谢你的帮助。
当用户通过点击通知启动应用程序时,didReceiveRemoteNotification方法不会触发,而不会在收到通知时触发,永远不会。
对不起,我的英语不好,如果你有问题,请不要犹豫。
发布于 2017-09-26 12:31:43
首先导入UserNotification框架,然后在ios10中实现UNUserNotificationCenterDelegate,以支持ios10中的推送通知。
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
//Handle notification tap
}https://stackoverflow.com/questions/43732711
复制相似问题