diff --git a/package.json b/package.json index 5cbd4f2..60b9993 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jpush-phonegap-plugin", - "version": "3.3.2", + "version": "3.3.3", "description": "JPush for cordova plugin", "cordova": { "id": "jpush-phonegap-plugin", diff --git a/plugin.xml b/plugin.xml index 9232aca..143c9ce 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="3.3.3"> JPush JPush for cordova plugin diff --git a/src/ios/Plugins/AppDelegate+JPush.m b/src/ios/Plugins/AppDelegate+JPush.m index fd2ce49..e4b759e 100644 --- a/src/ios/Plugins/AppDelegate+JPush.m +++ b/src/ios/Plugins/AppDelegate+JPush.m @@ -59,19 +59,19 @@ NSDictionary *_launchOptions; [JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[localNotificationEvent toJsonString]]; } } - - [JPUSHService setDebugMode]; - - NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"]; - NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; - NSNumber *delay = [plistData valueForKey:JPushConfig_Delay]; - - _launchOptions = notification.userInfo; - - if (![delay boolValue]) { - [self startJPushSDK]; - } } + + [JPUSHService setDebugMode]; + + NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"]; + NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; + NSNumber *delay = [plistData valueForKey:JPushConfig_Delay]; + + _launchOptions = notification.userInfo; + + if (![delay boolValue]) { + [self startJPushSDK]; + } } -(void)startJPushSDK{ @@ -137,14 +137,12 @@ NSDictionary *_launchOptions; [JPUSHService handleRemoteNotification:userInfo]; NSString *eventName; switch ([UIApplication sharedApplication].applicationState) { - case UIApplicationStateActive: - eventName = JPushDocumentEvent_ReceiveNotification; - break; - case UIApplicationStateBackground: - eventName = JPushDocumentEvent_BackgroundNotification; - break; - default: - break; + case UIApplicationStateBackground: + eventName = JPushDocumentEvent_BackgroundNotification; + break; + default: + eventName = JPushDocumentEvent_ReceiveNotification; + break; } [JPushPlugin fireDocumentEvent:eventName jsString:[[self jpushFormatAPNSDic:userInfo] toJsonString]];