Compare commits

...

10 Commits

Author SHA1 Message Date
JoshLipan 23ae6ad342 Merge pull request #390 from jpush/dev
Dev
2018-12-28 17:32:40 +08:00
JoshLi ccfffc9a69 Release v3.6.1 2018-12-28 17:28:12 +08:00
JoshLi 16c3c96844 Add API setGeofenceInterval for Android 2018-12-28 17:27:31 +08:00
JoshLipan b2e818e88d Merge pull request #387 from jpush/dev
Dev
2018-12-20 16:27:34 +08:00
HuminiOS 30fc85fc8d Merge pull request #381 from jpush/dev
update readme add xcode10 fq
2018-11-14 14:35:16 +08:00
JoshLipan 8de93a3a07 Merge pull request #380 from jpush/dev
Dev
2018-11-13 16:48:32 +08:00
HuminiOS 387eaa1aff Merge pull request #376 from jpush/dev
update to ios sdk to 3.1.1
2018-10-26 10:41:16 +08:00
HuminiOS 0c8a6d25a6 Merge pull request #374 from jpush/dev
Dev
2018-10-23 18:17:22 +08:00
JoshLipan 894c7d7ac1 Merge pull request #373 from jpush/dev
Dev
2018-10-18 14:33:58 +08:00
huangminlinux 82d68c3562 Merge pull request #364 from jpush/dev
Dev
2018-07-31 17:13:54 +08:00
6 changed files with 58 additions and 5 deletions
+31 -1
View File
@@ -7,7 +7,7 @@
- [设置保留最近通知条数](#设置保留最近通知条数) - [设置保留最近通知条数](#设置保留最近通知条数)
- [本地通知](#本地通知) - [本地通知](#本地通知)
- [获取推送连接状态](#获取推送连接状态) - [获取推送连接状态](#获取推送连接状态)
- [地理围栏](#地理围栏)
## 获取集成日志(同时适用于 iOS) ## 获取集成日志(同时适用于 iOS)
@@ -216,3 +216,33 @@ window.JPush.getConnectionState(function (result) {
} }
}) })
``` ```
## 地理围栏
### API - setGeofenceInterval
设置地理围栏监控周期,最小3分钟,最大1天。默认为15分钟,当距离地理围栏边界小于1000米周期自动调整为3分钟。设置成功后一直使用设置周期,不会进行调整。
#### 接口定义
```js
window.JPush.setGeofenceInterval(interval)
```
#### 参数说明
- interval: 监控周期,单位是毫秒。
### API - setMaxGeofenceNumber
设置最多允许保存的地理围栏数量,超过最大限制后,如果继续创建先删除最早创建的地理围栏。默认数量为10个,允许设置最小1个,最大100个。
#### 接口定义
```js
window.JPush.setMaxGeofenceNumber(maxNumber)
```
#### 参数说明
- maxNumber: 最多允许保存的地理围栏个数
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "jpush-phonegap-plugin", "name": "jpush-phonegap-plugin",
"version": "3.6.0", "version": "3.6.1",
"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.6.0"> version="3.6.1">
<name>JPush</name> <name>JPush</name>
<description>JPush for cordova plugin</description> <description>JPush for cordova plugin</description>
+11
View File
@@ -627,6 +627,16 @@ public class JPushPlugin extends CordovaPlugin {
} }
} }
void setGeofenceInterval(JSONArray data, CallbackContext callbackContext) throws JSONException {
long interval = data.getLong(0);
JPushInterface.setGeofenceInterval(this.cordova.getActivity(), interval);
}
void setMaxGeofenceNumber(JSONArray data, CallbackContext callbackContext) throws JSONException {
int maxNumber = data.getInt(0);
JPushInterface.setMaxGeofenceNumber(mContext, maxNumber);
}
private boolean isValidHour(int hour) { private boolean isValidHour(int hour) {
return !(hour < 0 || hour > 23); return !(hour < 0 || hour > 23);
} }
@@ -706,4 +716,5 @@ public class JPushPlugin extends CordovaPlugin {
return false; return false;
} }
} }
+1 -1
View File
@@ -14,7 +14,7 @@ import cn.jpush.android.api.JPushInterface;
public class JPushReceiver extends BroadcastReceiver { public class JPushReceiver extends BroadcastReceiver {
private static final List<String> IGNORED_EXTRAS_KEYS = Arrays.asList("cn.jpush.android.TITLE", private static final List<String> IGNORED_EXTRAS_KEYS = Arrays.asList("cn.jpush.android.TITLE",
"cn.jpush.android.MESSAGE", "cn.jpush.android.APPKEY", "cn.jpush.android.NOTIFICATION_CONTENT_TITLE"); "cn.jpush.android.MESSAGE", "cn.jpush.android.APPKEY", "cn.jpush.android.NOTIFICATION_CONTENT_TITLE","key_show_entity","platform");
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
+12
View File
@@ -463,6 +463,18 @@ JPushPlugin.prototype.setPushTime = function(weekdays, startHour, endHour) {
} }
}; };
JPushPlugin.prototype.setGeofenceInterval = function(interval) {
if (device.platform === "Android") {
this.callNative("setGeofenceInterval", [interval], null);
}
};
JPushPlugin.prototype.setMaxGeofenceNumber = function(maxNumber) {
if (device.platform === "Android") {
this.callNative("setMaxGeofenceNumber", [maxNumber], null);
}
};
if (!window.plugins) { if (!window.plugins) {
window.plugins = {}; window.plugins = {};
} }