IOS-通过单击UNNotificationAction处理后的富推送复制

IOS-通过单击UNNotificationAction处理后的富推送复制,ios,swift,push-notification,apple-push-notifications,richpush,Ios,Swift,Push Notification,Apple Push Notifications,Richpush,在后台处理富推送后(用户在未打开应用程序的情况下单击未通知的操作-无前台)),然后当您进入应用程序时,会出现重复推送事件,导致执行“DidReceiveEmotentification” 我的问题是: UNUserNotificationCenter.current().delegate = self UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (gra

在后台处理富推送后(用户在未打开应用程序的情况下单击未通知的操作-无前台)),然后当您进入应用程序时,会出现重复推送事件,导致执行“DidReceiveEmotentification”

我的问题是:

UNUserNotificationCenter.current().delegate = self

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
                if granted {
                    print("UNUserNotificationCenter auth granted")
                    Utils.performTaskOnMain {
                        application.registerForRemoteNotifications()
                    }
                } else {
                    print("UNUserNotificationCenter auth error = \(error?.localizedDescription ?? "")")

                }
info:[AnyHashable("content-available"): 1, AnyHashable("messageInfo"): {"push_type":"XXXX","category":"videoCategory","mediaUrl":"https://XXXX.png","threadId":"24274","alertTitle":null,"initiator":"XXXXX XXXX.mp3","alertBody":null,"mutableContent":true}, AnyHashable("media-url"): https://XXXXX.png, AnyHashable("aps"): {
alert =     {
    body = "XXXXX";
};
badge = 56;
category = "XXX.videoCategory";
"content-available" = 1;
"mutable-content" = 1;
sound = "XXXX.mp3";
为什么当我处理富人推进来:

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
和调用competionHandler(),在中接收到相同的推送:

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
?

推送设置:

UNUserNotificationCenter.current().delegate = self

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
                if granted {
                    print("UNUserNotificationCenter auth granted")
                    Utils.performTaskOnMain {
                        application.registerForRemoteNotifications()
                    }
                } else {
                    print("UNUserNotificationCenter auth error = \(error?.localizedDescription ?? "")")

                }
info:[AnyHashable("content-available"): 1, AnyHashable("messageInfo"): {"push_type":"XXXX","category":"videoCategory","mediaUrl":"https://XXXX.png","threadId":"24274","alertTitle":null,"initiator":"XXXXX XXXX.mp3","alertBody":null,"mutableContent":true}, AnyHashable("media-url"): https://XXXXX.png, AnyHashable("aps"): {
alert =     {
    body = "XXXXX";
};
badge = 56;
category = "XXX.videoCategory";
"content-available" = 1;
"mutable-content" = 1;
sound = "XXXX.mp3";
推送处理程序

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)
    {
        print("AppDelegate didReceiveRemoteNotification, with info:\(userInfo)")
        handleNotificationUserInfo(userInfo)
        completionHandler(UIBackgroundFetchResult.newData)
    }


    @available(iOS 10.0, *)
    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
                 UserNotificationsManager.shared.handleActionIdentifierForReceivedNotification(response)
         completionHandler()
    }
推送通知有效负载:

UNUserNotificationCenter.current().delegate = self

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
                if granted {
                    print("UNUserNotificationCenter auth granted")
                    Utils.performTaskOnMain {
                        application.registerForRemoteNotifications()
                    }
                } else {
                    print("UNUserNotificationCenter auth error = \(error?.localizedDescription ?? "")")

                }
info:[AnyHashable("content-available"): 1, AnyHashable("messageInfo"): {"push_type":"XXXX","category":"videoCategory","mediaUrl":"https://XXXX.png","threadId":"24274","alertTitle":null,"initiator":"XXXXX XXXX.mp3","alertBody":null,"mutableContent":true}, AnyHashable("media-url"): https://XXXXX.png, AnyHashable("aps"): {
alert =     {
    body = "XXXXX";
};
badge = 56;
category = "XXX.videoCategory";
"content-available" = 1;
"mutable-content" = 1;
sound = "XXXX.mp3";
}]

发送到应用程序的“重复”推送是一个静默推送通知。推送通知除了包含
警报
字典外,还包含
可用内容

警报
字典会导致发送用户可见的通知

content available
键使其以静默推送通知的形式再次发送,用户看不到该通知


这是不受支持的配置。删除可用的
内容
键,只会发送用户可见的推送通知。如果您正在积极使用静默推送,请将其作为单独的推送发送,其中仅包含可用的
内容
类别
和您的自定义密钥。

请使用推送通知有效负载中的数据更新您的问题。添加了推送通知有效负载如果您所说的是正确的,这应该总是发生在我身上,但这只是在客户端多次终止应用程序后才附加的,我总是使用这种配置,直到我开始使用rice push。你能添加说明这一点的文档吗?谢谢!