Compare commits

...

3 Commits

Author SHA1 Message Date
huangminlinux
67421b5091 fix application in activity notification will not alert in ios10 2018-02-01 10:11:03 +08:00
huangminlinux
83b7ca162a update to 3.3.1 2018-01-31 16:19:17 +08:00
huangminlinux
7f2179fe32 fix backgroup notification event fire twice 2018-01-31 16:12:31 +08:00
3 changed files with 10 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "jpush-phonegap-plugin",
"version": "3.3.0",
"version": "3.3.2",
"description": "JPush for cordova plugin",
"cordova": {
"id": "jpush-phonegap-plugin",

View File

@@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="jpush-phonegap-plugin"
version="3.3.0">
version="3.3.2">
<name>JPush</name>
<description>JPush for cordova plugin</description>

View File

@@ -156,7 +156,7 @@ NSDictionary *_launchOptions;
}
-(void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{
NSMutableDictionary *userInfo = @[].mutableCopy;
NSMutableDictionary *userInfo = @{}.mutableCopy;
if ([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
userInfo = [self jpushFormatAPNSDic:notification.request.content.userInfo];
@@ -169,8 +169,14 @@ NSDictionary *_launchOptions;
userInfo[@"identifier"] = notification.request.identifier;
}
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]];
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert);
if ([userInfo[@"aps"][@"content-available"] isEqualToNumber:@(1)]) {// content-available
return;
}
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]];
}
-(void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler{