mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 13:52:49 +08:00
fix app not launch open notification will fire twice bug
This commit is contained in:
parent
67421b5091
commit
8ccdbd525b
@ -40,7 +40,8 @@ NSDictionary *_launchOptions;
|
||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_receiveRegistrationId jsString:[event toJsonString]];
|
||||
}];
|
||||
|
||||
if (notification) {
|
||||
if (notification != nil &&
|
||||
[[UIDevice currentDevice].systemVersion floatValue] < 10.0) {// iOS 10 以后通过 openNotification 这个回调触发事件。
|
||||
if (notification.userInfo) {
|
||||
|
||||
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
|
||||
@ -136,9 +137,6 @@ NSDictionary *_launchOptions;
|
||||
[JPUSHService handleRemoteNotification:userInfo];
|
||||
NSString *eventName;
|
||||
switch ([UIApplication sharedApplication].applicationState) {
|
||||
case UIApplicationStateInactive:
|
||||
eventName = JPushDocumentEvent_OpenNotification;
|
||||
break;
|
||||
case UIApplicationStateActive:
|
||||
eventName = JPushDocumentEvent_ReceiveNotification;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user