更新安卓jpush570+新增setDataInsightsEnable接口+更新版本号为5.7.0

This commit is contained in:
huangshuni 2025-05-09 14:53:12 +08:00
parent f140784c9c
commit 795242e0c9
5 changed files with 20 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "jpush-phonegap-plugin",
"version": "5.6.0",
"version": "5.7.0",
"description": "JPush for cordova plugin",
"cordova": {
"id": "jpush-phonegap-plugin",

View File

@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="jpush-phonegap-plugin"
version="5.6.0">
version="5.7.0">
<name>JPush</name>
<description>JPush for cordova plugin</description>
@ -244,7 +244,7 @@
android:writePermission="${applicationId}.permission.JPUSH_MESSAGE" />
</config-file>
<lib-file src="src/android/libs/jpush-android-5.6.0.jar" />
<lib-file src="src/android/libs/jpush-android-5.7.0.jar" />
<source-file src="src/android/PushService.java" target-dir="src/cn/jiguang/cordova/push" />
<source-file src="src/android/JPushPlugin.java" target-dir="src/cn/jiguang/cordova/push" />

View File

@ -285,6 +285,17 @@ public class JPushPlugin extends CordovaPlugin {
}
}
void setDataInsightsEnable(JSONArray data, CallbackContext callbackContext) {
boolean mode;
try {
mode = data.getBoolean(0);
JPushInterface.setDataInsightsEnable(mContext,mode);
callbackContext.success();
} catch (JSONException e) {
e.printStackTrace();
}
}
void stopPush(JSONArray data, CallbackContext callbackContext) {
JPushInterface.stopPush(mContext);
callbackContext.success();

View File

@ -59,6 +59,12 @@ JPushPlugin.prototype.setDebugMode = function(mode) {
}
};
JPushPlugin.prototype.setDataInsightsEnable = function(mode) {
if (device.platform === "Android") {
this.callNative("setDataInsightsEnable", [mode], null);
}
};
JPushPlugin.prototype.getRegistrationID = function(successCallback) {
this.callNative("getRegistrationID", [], successCallback);
};