From 67421b5091cb3e5982877df5d457918e52ad63a0 Mon Sep 17 00:00:00 2001 From: huangminlinux <380108184@qq.com> Date: Thu, 1 Feb 2018 10:11:03 +0800 Subject: [PATCH] fix application in activity notification will not alert in ios10 --- package.json | 2 +- plugin.xml | 2 +- src/ios/Plugins/AppDelegate+JPush.m | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5bc39ea..5cbd4f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jpush-phonegap-plugin", - "version": "3.3.1", + "version": "3.3.2", "description": "JPush for cordova plugin", "cordova": { "id": "jpush-phonegap-plugin", diff --git a/plugin.xml b/plugin.xml index 8f6dcc1..9232aca 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="3.3.2"> JPush JPush for cordova plugin diff --git a/src/ios/Plugins/AppDelegate+JPush.m b/src/ios/Plugins/AppDelegate+JPush.m index 793d965..fe0c50d 100644 --- a/src/ios/Plugins/AppDelegate+JPush.m +++ b/src/ios/Plugins/AppDelegate+JPush.m @@ -169,12 +169,14 @@ NSDictionary *_launchOptions; userInfo[@"identifier"] = notification.request.identifier; } + completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert); + if ([userInfo[@"aps"][@"content-available"] isEqualToNumber:@(1)]) {// content-available 当用户开启后台推送是,防止触发两次事件 return; } [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]]; - completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert); + } -(void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler{