diff --git a/README.md b/README.md index 2432dcb..9644598 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 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) -[![release](https://img.shields.io/badge/release-3.2.4-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases) +[![release](https://img.shields.io/badge/release-3.2.5-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) [![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1) diff --git a/doc/Android_detail_api.md b/doc/Android_detail_api.md index 1186652..532a4aa 100644 --- a/doc/Android_detail_api.md +++ b/doc/Android_detail_api.md @@ -2,7 +2,6 @@ - [注册成功事件](#注册成功事件) - [获取集成日志(同时适用于 iOS)](#获取集成日志同时适用于-ios) -- [统计分析](#统计分析) - [清除通知](#清除通知) - [设置允许推送时间](#设置允许推送时间) - [设置通知静默时间](#设置通知静默时间) diff --git a/package.json b/package.json index bbc7c96..96f3c48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jpush-phonegap-plugin", - "version": "3.2.4", + "version": "3.2.5", "description": "JPush for cordova plugin", "cordova": { "id": "jpush-phonegap-plugin", diff --git a/plugin.xml b/plugin.xml index 0a4a6f0..8dc727c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="3.2.5"> JPush JPush for cordova plugin @@ -72,20 +72,22 @@ + + + + - - - + @@ -187,12 +189,18 @@ android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false" /> + + + - + diff --git a/src/android/JPushPlugin.java b/src/android/JPushPlugin.java index 38ba9ff..f0491f0 100644 --- a/src/android/JPushPlugin.java +++ b/src/android/JPushPlugin.java @@ -39,15 +39,12 @@ import cn.jpush.android.service.JPushMessageReceiver; public class JPushPlugin extends CordovaPlugin { - private ExecutorService threadPool = Executors.newFixedThreadPool(1); - + private static final String TAG = JPushPlugin.class.getSimpleName(); + private Context mContext; - + private static JPushPlugin instance; private static Activity cordovaActivity; - private static String TAG = "JPushPlugin"; - - private static boolean isStatisticsOpened = false; // 是否开启统计分析功能 static String notificationTitle; static String notificationAlert; @@ -85,16 +82,7 @@ public class JPushPlugin extends CordovaPlugin { } } - public void onPause(boolean multitasking) { - if (isStatisticsOpened && multitasking) { - JPushInterface.onPause(this.cordova.getActivity()); - } - } - public void onResume(boolean multitasking) { - if (isStatisticsOpened && multitasking) { - JPushInterface.onResume(this.cordova.getActivity()); - } if (openNotificationAlert != null) { notificationAlert = null; transmitNotificationOpen(openNotificationTitle, openNotificationAlert, @@ -252,7 +240,7 @@ public class JPushPlugin extends CordovaPlugin { @Override public boolean execute(final String action, final JSONArray data, final CallbackContext callbackContext) throws JSONException { - threadPool.execute(new Runnable() { + cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { @@ -644,17 +632,6 @@ public class JPushPlugin extends CordovaPlugin { JPushInterface.clearLocalNotifications(this.cordova.getActivity()); } - /** - * 决定是否启用统计分析功能。 - */ - void setStatisticsOpen(JSONArray data, CallbackContext callbackContext) { - try { - isStatisticsOpened = data.getBoolean(0); - } catch (JSONException e) { - e.printStackTrace(); - } - } - /** * 设置通知静默时间 * http://docs.jpush.io/client/android_api/#api_5 diff --git a/src/android/libs/jpush-android-3.0.8.jar b/src/android/libs/jpush-android-3.0.8.jar deleted file mode 100755 index b72455e..0000000 Binary files a/src/android/libs/jpush-android-3.0.8.jar and /dev/null differ diff --git a/src/android/libs/jpush-android-3.0.9.jar b/src/android/libs/jpush-android-3.0.9.jar new file mode 100755 index 0000000..c815a5a Binary files /dev/null and b/src/android/libs/jpush-android-3.0.9.jar differ diff --git a/www/JPushPlugin.js b/www/JPushPlugin.js index 4c79699..a9c3266 100644 --- a/www/JPushPlugin.js +++ b/www/JPushPlugin.js @@ -311,21 +311,18 @@ JPushPlugin.prototype.receiveRegistrationIdInAndroidCallback = function (data) { JPushPlugin.prototype.receiveMessageInAndroidCallback = function (data) { data = JSON.stringify(data) - console.log('JPushPlugin:receiveMessageInAndroidCallback: ' + data) this.receiveMessage = JSON.parse(data) cordova.fireDocumentEvent('jpush.receiveMessage', this.receiveMessage) } JPushPlugin.prototype.openNotificationInAndroidCallback = function (data) { data = JSON.stringify(data) - console.log('JPushPlugin:openNotificationInAndroidCallback: ' + data) this.openNotification = JSON.parse(data) cordova.fireDocumentEvent('jpush.openNotification', this.openNotification) } JPushPlugin.prototype.receiveNotificationInAndroidCallback = function (data) { data = JSON.stringify(data) - console.log('JPushPlugin:receiveNotificationInAndroidCallback: ' + data) this.receiveNotification = JSON.parse(data) cordova.fireDocumentEvent('jpush.receiveNotification', this.receiveNotification) } @@ -368,16 +365,6 @@ JPushPlugin.prototype.reportNotificationOpened = function (msgID) { } } -/** - *是否开启统计分析功能,用于“用户使用时长”,“活跃用户”,“用户打开次数”的统计,并上报到服务器上, - *在 Portal 上展示给开发者。 - */ -JPushPlugin.prototype.setStatisticsOpen = function (mode) { - if (device.platform === 'Android') { - this.callNative('setStatisticsOpen', [mode], null) - } -} - /** * 用于在 Android 6.0 及以上系统,申请一些权限 * 具体可看:http://docs.jpush.io/client/android_api/#android-60