From 3c70127405f70424f8c1cdd137b693d8b4d447de Mon Sep 17 00:00:00 2001 From: huangminlinux <380108184@qq.com> Date: Wed, 12 Jul 2017 10:14:26 +0800 Subject: [PATCH] fix notification in backgroup bug --- src/ios/Plugins/AppDelegate+JPush.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ios/Plugins/AppDelegate+JPush.m b/src/ios/Plugins/AppDelegate+JPush.m index 1d8af8b..0cd5a51 100644 --- a/src/ios/Plugins/AppDelegate+JPush.m +++ b/src/ios/Plugins/AppDelegate+JPush.m @@ -119,7 +119,9 @@ NSDictionary *_launchOptions; break; } [JPushPlugin fireDocumentEvent:eventName jsString:[userInfo toJsonString]]; - completionHandler(UIBackgroundFetchResultNewData); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + completionHandler(UIBackgroundFetchResultNewData); + }); } -(void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{