mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-03-03 21:32:51 +08:00
增加统计接口
This commit is contained in:
parent
7c1c29a7ec
commit
260c298f6b
@ -48,7 +48,10 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
"clearAllNotification",
|
"clearAllNotification",
|
||||||
"addLocalNotification",
|
"addLocalNotification",
|
||||||
"removeLocalNotification",
|
"removeLocalNotification",
|
||||||
"clearLocalNotifications");
|
"clearLocalNotifications",
|
||||||
|
"onResume",
|
||||||
|
"onPause",
|
||||||
|
"reportNotificationOpened");
|
||||||
|
|
||||||
private ExecutorService threadPool = Executors.newFixedThreadPool(1);
|
private ExecutorService threadPool = Executors.newFixedThreadPool(1);
|
||||||
private static JPushPlugin instance;
|
private static JPushPlugin instance;
|
||||||
@ -252,6 +255,23 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
String regID= JPushInterface.getRegistrationID(this.cordova.getActivity().getApplicationContext());
|
String regID= JPushInterface.getRegistrationID(this.cordova.getActivity().getApplicationContext());
|
||||||
callbackContext.success(regID);
|
callbackContext.success(regID);
|
||||||
|
|
||||||
|
}
|
||||||
|
void onResume(JSONArray data, CallbackContext callbackContext) {
|
||||||
|
JPushInterface.onResume(this.cordova.getActivity());
|
||||||
|
}
|
||||||
|
void onPause(JSONArray data, CallbackContext callbackContext) {
|
||||||
|
JPushInterface.onPause(this.cordova.getActivity());
|
||||||
|
}
|
||||||
|
void reportNotificationOpened(JSONArray data, CallbackContext callbackContext) {
|
||||||
|
try {
|
||||||
|
String msgID;
|
||||||
|
msgID = data.getString(0);
|
||||||
|
JPushInterface.reportNotificationOpened(this.cordova.getActivity(),msgID);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void setTags(JSONArray data, CallbackContext callbackContext) {
|
void setTags(JSONArray data, CallbackContext callbackContext) {
|
||||||
|
|
||||||
|
@ -149,6 +149,7 @@ JPushPlugin.prototype.receiveMessageInAndroidCallback = function(data){
|
|||||||
console.log("JPushPlugin:pushCallback "+exception);
|
console.log("JPushPlugin:pushCallback "+exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
JPushPlugin.prototype.openNotificationInAndroidCallback = function(data){
|
JPushPlugin.prototype.openNotificationInAndroidCallback = function(data){
|
||||||
try{
|
try{
|
||||||
@ -253,6 +254,25 @@ JPushPlugin.prototype.clearLocalNotifications = function(){
|
|||||||
this.call_native("clearLocalNotifications",data,null);
|
this.call_native("clearLocalNotifications",data,null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
JPushPlugin.prototype.onResume = function(){
|
||||||
|
if(device.platform == "Android") {
|
||||||
|
data=[]
|
||||||
|
this.call_native("onResume",data,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JPushPlugin.prototype.onPause = function(){
|
||||||
|
if(device.platform == "Android") {
|
||||||
|
data=[]
|
||||||
|
this.call_native("onPause",data,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JPushPlugin.prototype.reportNotificationOpened = function(msgID){
|
||||||
|
if(device.platform == "Android") {
|
||||||
|
|
||||||
|
this.call_native("reportNotificationOpened",[msgID],null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//iOS single
|
//iOS single
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user