mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-31 22:42:51 +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]];
|
[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) {
|
||||||
|
|
||||||
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
|
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
|
||||||
@ -136,9 +137,6 @@ NSDictionary *_launchOptions;
|
|||||||
[JPUSHService handleRemoteNotification:userInfo];
|
[JPUSHService handleRemoteNotification:userInfo];
|
||||||
NSString *eventName;
|
NSString *eventName;
|
||||||
switch ([UIApplication sharedApplication].applicationState) {
|
switch ([UIApplication sharedApplication].applicationState) {
|
||||||
case UIApplicationStateInactive:
|
|
||||||
eventName = JPushDocumentEvent_OpenNotification;
|
|
||||||
break;
|
|
||||||
case UIApplicationStateActive:
|
case UIApplicationStateActive:
|
||||||
eventName = JPushDocumentEvent_ReceiveNotification;
|
eventName = JPushDocumentEvent_ReceiveNotification;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user