From 0be20344ccc1d248a12bac06f3c115f4d16dc71d Mon Sep 17 00:00:00 2001 From: iflamed Date: Tue, 17 Jan 2017 16:51:14 +0800 Subject: [PATCH] fix the extras parse error --- www/cordova-huawei-push.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/cordova-huawei-push.js b/www/cordova-huawei-push.js index e8daee8..2f18bbd 100644 --- a/www/cordova-huawei-push.js +++ b/www/cordova-huawei-push.js @@ -24,7 +24,8 @@ HuaweiPush.prototype.pushMsgReceived = function (msg) { } HuaweiPush.prototype.notificationOpened = function (msg) { try { - this.receiveRegisterResult = JSON.parse(msg); + msg.extras = JSON.parse(msg.extras) + this.receiveRegisterResult = msg; cordova.fireDocumentEvent('huaweipush.notificationOpened', this.receiveRegisterResult); } catch(exception) { console.log('HuaweiPush:notificationOpened ' + exception);