forked from github/jpush-phonegap-plugin
Remove unused code
This commit is contained in:
parent
155f1e2f6c
commit
9f156727e7
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
- [注册成功事件](#注册成功事件)
|
- [注册成功事件](#注册成功事件)
|
||||||
- [获取集成日志(同时适用于 iOS)](#获取集成日志同时适用于-ios)
|
- [获取集成日志(同时适用于 iOS)](#获取集成日志同时适用于-ios)
|
||||||
- [统计分析](#统计分析)
|
|
||||||
- [清除通知](#清除通知)
|
- [清除通知](#清除通知)
|
||||||
- [设置允许推送时间](#设置允许推送时间)
|
- [设置允许推送时间](#设置允许推送时间)
|
||||||
- [设置通知静默时间](#设置通知静默时间)
|
- [设置通知静默时间](#设置通知静默时间)
|
||||||
|
@ -39,15 +39,12 @@ import cn.jpush.android.service.JPushMessageReceiver;
|
|||||||
|
|
||||||
public class JPushPlugin extends CordovaPlugin {
|
public class JPushPlugin extends CordovaPlugin {
|
||||||
|
|
||||||
private ExecutorService threadPool = Executors.newFixedThreadPool(1);
|
private static final String TAG = JPushPlugin.class.getSimpleName();
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
private static JPushPlugin instance;
|
private static JPushPlugin instance;
|
||||||
private static Activity cordovaActivity;
|
private static Activity cordovaActivity;
|
||||||
private static String TAG = "JPushPlugin";
|
|
||||||
|
|
||||||
private static boolean isStatisticsOpened = false; // 是否开启统计分析功能
|
|
||||||
|
|
||||||
static String notificationTitle;
|
static String notificationTitle;
|
||||||
static String notificationAlert;
|
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) {
|
public void onResume(boolean multitasking) {
|
||||||
if (isStatisticsOpened && multitasking) {
|
|
||||||
JPushInterface.onResume(this.cordova.getActivity());
|
|
||||||
}
|
|
||||||
if (openNotificationAlert != null) {
|
if (openNotificationAlert != null) {
|
||||||
notificationAlert = null;
|
notificationAlert = null;
|
||||||
transmitNotificationOpen(openNotificationTitle, openNotificationAlert,
|
transmitNotificationOpen(openNotificationTitle, openNotificationAlert,
|
||||||
@ -252,7 +240,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(final String action, final JSONArray data,
|
public boolean execute(final String action, final JSONArray data,
|
||||||
final CallbackContext callbackContext) throws JSONException {
|
final CallbackContext callbackContext) throws JSONException {
|
||||||
threadPool.execute(new Runnable() {
|
cordova.getThreadPool().execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@ -644,17 +632,6 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
JPushInterface.clearLocalNotifications(this.cordova.getActivity());
|
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
|
* http://docs.jpush.io/client/android_api/#api_5
|
||||||
|
@ -365,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 及以上系统,申请一些权限
|
* 用于在 Android 6.0 及以上系统,申请一些权限
|
||||||
* 具体可看:http://docs.jpush.io/client/android_api/#android-60
|
* 具体可看:http://docs.jpush.io/client/android_api/#android-60
|
||||||
|
Loading…
x
Reference in New Issue
Block a user