Compare commits

..

14 Commits

Author SHA1 Message Date
Hevin edf29bbc8d Merge branch 'dev' 2017-09-28 10:25:03 +08:00
Hevin ae54960da4 Merge branch 'dev' 2017-09-26 18:28:44 +08:00
Hevin ea6011635f Merge branch 'dev' 2017-09-25 12:32:36 +08:00
Hevin 0829104534 Merge branch 'dev' 2017-09-23 09:11:34 +08:00
Hevin 592d5a5fb9 Merge branch 'dev' 2017-09-22 21:16:11 +08:00
Hevin 4753174bda Merge branch 'dev' 2017-09-22 20:24:21 +08:00
Hevin 3f077e32fd Merge branch 'dev' 2017-09-19 14:33:24 +08:00
Hevin 5c569d00da Merge branch 'dev' 2017-09-08 14:32:18 +08:00
Hevin c5f7963425 Merge branch 'dev' 2017-07-21 14:15:57 +08:00
Hevin a4eaf51455 Merge branch 'dev' 2017-07-21 14:00:30 +08:00
Hevin 04fae7d538 Merge branch 'dev' 2017-07-12 10:16:49 +08:00
Hevin 8e087e102a Merge branch 'dev' 2017-07-07 11:26:20 +08:00
Hevin 35c09c0c92 Merge branch 'dev' 2017-07-04 17:51:51 +08:00
Hevin f0a87962e7 Merge branch 'dev' 2017-06-30 15:44:35 +08:00
6 changed files with 167 additions and 174 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
# JPush PhoneGap / Cordova Plugin # JPush PhoneGap / Cordova Plugin
[![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin) [![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin)
[![release](https://img.shields.io/badge/release-3.2.7-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases) [![release](https://img.shields.io/badge/release-3.2.6-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin) [![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin)
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1) [![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
+6
View File
@@ -437,7 +437,9 @@ window.JPush.clearAllLocalNotifications()
监听 [jpush.receiveNotification](#前台收到推送)、[jpush.openNotification](点击推送通知),获取推送内容后,通过获取到的 `__JPUSHNotificationKey` 字段([本地通知](#本地通知) 设置的 `notificationID`)来判断是本地通知,并处理。 监听 [jpush.receiveNotification](#前台收到推送)、[jpush.openNotification](点击推送通知),获取推送内容后,通过获取到的 `__JPUSHNotificationKey` 字段([本地通知](#本地通知) 设置的 `notificationID`)来判断是本地通知,并处理。
### 点击本地通知横幅启动 App
监听 `jpush.startLocalNotification` 事件。
## 页面的统计 ## 页面的统计
@@ -724,6 +726,10 @@ window.JPush.getUserNotificationSettings(callback)
[获取自定义消息内容](#获取自定义消息内容) [获取自定义消息内容](#获取自定义消息内容)
### jpush.startLocalNotification
[点击本地通知横幅启动 App](#点击本地通知横幅启动-app)
### jpush.receiveLocalNotification ### jpush.receiveLocalNotification
[iOS 10 before 收到本地通知](#ios-10-before-收到本地通知) [iOS 10 before 收到本地通知](#ios-10-before-收到本地通知)
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "jpush-phonegap-plugin", "name": "jpush-phonegap-plugin",
"version": "3.2.7", "version": "3.2.6",
"description": "JPush for cordova plugin", "description": "JPush for cordova plugin",
"cordova": { "cordova": {
"id": "jpush-phonegap-plugin", "id": "jpush-phonegap-plugin",
+1 -1
View File
@@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
id="jpush-phonegap-plugin" id="jpush-phonegap-plugin"
version="3.2.7"> version="3.2.6">
<name>JPush</name> <name>JPush</name>
<description>JPush for cordova plugin</description> <description>JPush for cordova plugin</description>
+6 -20
View File
@@ -38,28 +38,19 @@
NSDictionary *_launchOptions; NSDictionary *_launchOptions;
-(void)applicationDidLaunch:(NSNotification *)notification{ -(void)applicationDidLaunch:(NSNotification *)notification{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jpushSDKDidLoginNotification) name:kJPFNetworkDidLoginNotification object:nil];
if (notification) { if (notification) {
if (notification.userInfo) { if (notification.userInfo) {
NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) { if (userInfo1.count > 0) {
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo1 repeats:YES];
userInfo:[notification.userInfo
valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey] repeats:YES];
} }
if ([notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey]) { NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
UILocalNotification *localNotification = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey]; if (userInfo2.count > 0) {
[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"];
@@ -79,11 +70,6 @@ NSDictionary *_launchOptions;
[JPushPlugin setupJPushSDK:_launchOptions]; [JPushPlugin setupJPushSDK:_launchOptions];
} }
- (void)jpushSDKDidLoginNotification {
NSDictionary *event = @{@"registrationId": JPUSHService.registrationID};
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_receiveRegistrationId jsString:[event toJsonString]];
}
-(void)registerForRemoteNotification{ -(void)registerForRemoteNotification{
if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) { if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
#ifdef NSFoundationVersionNumber_iOS_9_x_Max #ifdef NSFoundationVersionNumber_iOS_9_x_Max
+2 -1
View File
@@ -27,6 +27,7 @@ static NSString *const JPushDocumentEvent_OpenNotification = @"openNoti
static NSString *const JPushDocumentEvent_BackgroundNotification = @"backgroundNotification"; static NSString *const JPushDocumentEvent_BackgroundNotification = @"backgroundNotification";
static NSString *const JPushDocumentEvent_SetTagsWithAlias = @"setTagsWithAlias"; static NSString *const JPushDocumentEvent_SetTagsWithAlias = @"setTagsWithAlias";
static NSString *const JPushDocumentEvent_ReceiveMessage = @"receiveMessage"; static NSString *const JPushDocumentEvent_ReceiveMessage = @"receiveMessage";
static NSString *const JPushDocumentEvent_StartLocalNotification = @"startLocalNotification";
static NSString *const JPushDocumentEvent_ReceiveLocalNotification = @"receiveLocalNotification"; static NSString *const JPushDocumentEvent_ReceiveLocalNotification = @"receiveLocalNotification";
static NSString *const JPushDocumentEvent_receiveRegistrationId = @"receiveRegistrationId";