mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-04-15 11:50:22 +08:00
commit
13341fd68a
@ -437,9 +437,7 @@ window.JPush.clearAllLocalNotifications()
|
||||
|
||||
监听 [jpush.receiveNotification](#前台收到推送)、[jpush.openNotification](点击推送通知),获取推送内容后,通过获取到的 `__JPUSHNotificationKey` 字段([本地通知](#本地通知) 设置的 `notificationID`)来判断是本地通知,并处理。
|
||||
|
||||
### 点击本地通知横幅启动 App
|
||||
|
||||
监听 `jpush.startLocalNotification` 事件。
|
||||
|
||||
## 页面的统计
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
NSDictionary *_launchOptions;
|
||||
-(void)applicationDidLaunch:(NSNotification *)notification{
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jpushSDKDidLoginNotification) name:kJPFNetworkDidLoginNotification object:nil];
|
||||
|
||||
if (notification) {
|
||||
if (notification.userInfo) {
|
||||
@ -70,6 +71,11 @@ NSDictionary *_launchOptions;
|
||||
[JPushPlugin setupJPushSDK:_launchOptions];
|
||||
}
|
||||
|
||||
- (void)jpushSDKDidLoginNotification {
|
||||
NSDictionary *event = @{@"registrationId": JPUSHService.registrationID};
|
||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_receiveRegistrationId jsString:[event toJsonString]];
|
||||
}
|
||||
|
||||
-(void)registerForRemoteNotification{
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
|
||||
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
|
||||
|
@ -27,7 +27,6 @@ static NSString *const JPushDocumentEvent_OpenNotification = @"openNoti
|
||||
static NSString *const JPushDocumentEvent_BackgroundNotification = @"backgroundNotification";
|
||||
static NSString *const JPushDocumentEvent_SetTagsWithAlias = @"setTagsWithAlias";
|
||||
static NSString *const JPushDocumentEvent_ReceiveMessage = @"receiveMessage";
|
||||
static NSString *const JPushDocumentEvent_StartLocalNotification = @"startLocalNotification";
|
||||
static NSString *const JPushDocumentEvent_ReceiveLocalNotification = @"receiveLocalNotification";
|
||||
|
||||
|
||||
static NSString *const JPushDocumentEvent_receiveRegistrationId = @"receiveRegistrationId";
|
||||
|
Loading…
x
Reference in New Issue
Block a user