add jpush.receiveNotificaiton event in platform android

This commit is contained in:
zhangqinghe
2015-06-09 15:48:51 +08:00
parent c90c9b7b01
commit c420ae20e5
4 changed files with 72 additions and 10 deletions

View File

@@ -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(){