mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-01-28 00:00:03 +08:00
add jpush.receiveNotificaiton event in platform android
This commit is contained in:
@@ -6,6 +6,7 @@ var JPushPlugin = function(){
|
||||
|
||||
JPushPlugin.prototype.receiveMessage={}
|
||||
JPushPlugin.prototype.openNotification={}
|
||||
JPushPlugin.prototype.receiveNotification={}
|
||||
|
||||
|
||||
JPushPlugin.prototype.isPlatformIOS = function(){
|
||||
@@ -188,6 +189,31 @@ JPushPlugin.prototype.openNotificationInAndroidCallback = function(data){
|
||||
console.log(exception);
|
||||
}
|
||||
}
|
||||
JPushPlugin.prototype.receiveNotificationInAndroidCallback = function(data){
|
||||
try{
|
||||
console.log("JPushPlugin:receiveNotificationInAndroidCallback");
|
||||
var bToObj = JSON.parse(data);
|
||||
this.receiveNotification=bToObj;
|
||||
cordova.fireDocumentEvent('jpush.receiveNotification',null);
|
||||
|
||||
//console.log(data);
|
||||
//var bToObj = JSON.parse(data);
|
||||
//var alert = bToObj.alert;
|
||||
//var extras = bToObj.extras;
|
||||
//console.log(alert);
|
||||
|
||||
//console.log(extras['cn.jpush.android.MSG_ID']);
|
||||
//console.log(extras['app']);
|
||||
//console.log(extras['cn.jpush.android.NOTIFICATION_CONTENT_TITLE']);
|
||||
//console.log(extras['cn.jpush.android.EXTRA']);
|
||||
//console.log(extras['cn.jpush.android.PUSH_ID']);
|
||||
//console.log(extras['cn.jpush.android.NOTIFICATION_ID']);
|
||||
//console.log("JPushPlugin:openNotificationCallback is ready");
|
||||
}
|
||||
catch(exception){
|
||||
console.log(exception);
|
||||
}
|
||||
}
|
||||
//android single
|
||||
|
||||
JPushPlugin.prototype.setBasicPushNotificationBuilder = function(){
|
||||
|
||||
Reference in New Issue
Block a user