mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-20 07:02:50 +08:00
open notification event add to jpush event cache
This commit is contained in:
parent
3129165d3f
commit
d2f9959ae1
@ -28,13 +28,6 @@
|
|||||||
return [self init_plus];
|
return [self init_plus];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)fireOpenNotification:(NSTimer*)timer{
|
|
||||||
if (SharedJPushPlugin) {
|
|
||||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[timer.userInfo toJsonString]];
|
|
||||||
[timer invalidate];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NSDictionary *_launchOptions;
|
NSDictionary *_launchOptions;
|
||||||
-(void)applicationDidLaunch:(NSNotification *)notification{
|
-(void)applicationDidLaunch:(NSNotification *)notification{
|
||||||
|
|
||||||
@ -48,9 +41,7 @@ NSDictionary *_launchOptions;
|
|||||||
if (notification.userInfo) {
|
if (notification.userInfo) {
|
||||||
|
|
||||||
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
|
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:)
|
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[notification.userInfo toJsonString]];
|
||||||
userInfo:[notification.userInfo
|
|
||||||
valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey] repeats:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey]) {
|
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey]) {
|
||||||
@ -60,7 +51,7 @@ NSDictionary *_launchOptions;
|
|||||||
@"badge": @(localNotification.applicationIconBadgeNumber),
|
@"badge": @(localNotification.applicationIconBadgeNumber),
|
||||||
@"extras":localNotification.userInfo,
|
@"extras":localNotification.userInfo,
|
||||||
};
|
};
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:localNotificationEvent repeats:YES];
|
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[localNotificationEvent toJsonString]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user