mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-04-19 00:03:45 +08:00
fix android message and notification event
This commit is contained in:
+14
-3
@@ -1,8 +1,13 @@
|
||||
|
||||
var JPushPlugin = function(){
|
||||
};
|
||||
|
||||
//private plugin function
|
||||
|
||||
JPushPlugin.prototype.receiveMessage={}
|
||||
JPushPlugin.prototype.openNotification={}
|
||||
|
||||
|
||||
JPushPlugin.prototype.isPlatformIOS = function(){
|
||||
return device.platform == "iPhone" || device.platform == "iPad" || device.platform == "iPod touch" || device.platform == "iOS"
|
||||
}
|
||||
@@ -140,8 +145,10 @@ JPushPlugin.prototype.receiveMessageIniOSCallback = function(data){
|
||||
JPushPlugin.prototype.receiveMessageInAndroidCallback = function(data){
|
||||
try{
|
||||
console.log("JPushPlugin:receiveMessageInAndroidCallback");
|
||||
var bToObj = JSON.parse(data);
|
||||
this.openNotification=bToObj
|
||||
cordova.fireDocumentEvent('jpush.receiveMessage',null);
|
||||
//console.log(data);
|
||||
//ecvar bToObj=JSON.parse(data);
|
||||
//var message = bToObj.message;
|
||||
//var extras = bToObj.extras;
|
||||
|
||||
@@ -158,8 +165,12 @@ JPushPlugin.prototype.receiveMessageInAndroidCallback = function(data){
|
||||
//
|
||||
JPushPlugin.prototype.openNotificationInAndroidCallback = function(data){
|
||||
try{
|
||||
console.log("JPushPlugin:openNotificationInAndroidCallback");
|
||||
console.log(data);
|
||||
console.log("JPushPlugin:openNotificationInAndroidCallback");
|
||||
var bToObj = JSON.parse(data);
|
||||
this.receiveNotification=bToObj;
|
||||
cordova.fireDocumentEvent('jpush.openNotification',null);
|
||||
|
||||
//console.log(data);
|
||||
//var bToObj = JSON.parse(data);
|
||||
//var alert = bToObj.alert;
|
||||
//var extras = bToObj.extras;
|
||||
|
||||
Reference in New Issue
Block a user