如何在javascript中访问事件对象属性

时间:2015-12-17 10:13:10

标签: javascript cordova ionic-framework phonegap-plugins

我正在使用离子推送通知服务。

当应用程序收到推送时,它会触发onNotification事件 事件对象。

我有console.log"通知"对象,

但我如何访问 raw->additionalData->foreground.

enter image description here

我曾尝试使用notification.raw.additionalData.forground

notification.raw未定义。 有人可以给我一些提示吗?感谢。

var push = new Ionic.Push({
      "debug": true,
      "onNotification": function (notification) {
        var payload = notification.payload;
        //console.log(notification.raw.additionalData.foreground)
        // not work!! 
      }
    });

0 个答案:

没有答案