mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-03-16 22:11:04 +08:00
fix open local notification to launch app event bug
This commit is contained in:
parent
c726477cfb
commit
585e2a5084
@ -42,16 +42,24 @@ NSDictionary *_launchOptions;
|
|||||||
|
|
||||||
if (notification) {
|
if (notification) {
|
||||||
if (notification.userInfo) {
|
if (notification.userInfo) {
|
||||||
NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
|
|
||||||
if (userInfo1.count > 0) {
|
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo1 repeats:YES];
|
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:)
|
||||||
|
userInfo:[notification.userInfo
|
||||||
|
valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey] repeats:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
|
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey]) {
|
||||||
if (userInfo2.count > 0) {
|
UILocalNotification *localNotification = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo2 repeats:YES];
|
|
||||||
|
NSDictionary* localNotificationEvent = @{@"content":localNotification.alertBody,
|
||||||
|
@"badge": @(localNotification.applicationIconBadgeNumber),
|
||||||
|
@"extras":localNotification.userInfo,
|
||||||
|
};
|
||||||
|
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:localNotificationEvent repeats:YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[JPUSHService setDebugMode];
|
[JPUSHService setDebugMode];
|
||||||
|
|
||||||
NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"];
|
NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user