并没有做出一些有意义的推送通知

时间:2018-07-18 13:29:27

标签: push-notification ionic3 postman

谁可以看一下我的代码,我正在尝试在对象内部获取数据,但这是不可能的。 而且没有任何意义,我看到以太坊对象,在以太坊对象内部,我有一个名为balance的变量,但我根本无法理解它

config.ts

      console.log('----------balance------------');
      console.log( notification.additionalData.ethereum.balance);
      console.log('---------ethereum-------------');   
      console.log(notification.additionalData.ethereum);
      console.log('----------DATA------------');  
      console.log(notification.additionalData);
      console.log('----------notificaiton------------'); 
      console.log(notification);

邮递员

 "to" : "fHyGOQ1ugro:APA91bFz8xqgpL-9M9B5fQxqOcUJEQ0ZjsM2DVSbeXbiif8DDSGokKXipXhC2SoF7Mzim-A6bqB-S8lxr03W3tbNswdytP01Xdm4W_wBuJooS-dTo71bOqXlsq-nzaBp1EZt3GaVFFpa0M-DEAyuWqbRH-7RVX9_dJ4Tw",
 "notification" : {
 "title" : "tittle",
  "sound" : "default",

 "body" : "test"
 },
  "data" : {
     "ethereum" :{
        "balance": "122"
     }

  }
}

console.log

            2018-07-18 09:56:42.685056-0300 xxx[7771:905653] ----------balance------------
            2018-07-18 09:56:42.685416-0300 xxx[7771:905653] 
            2018-07-18 09:56:42.685773-0300 xxx[7771:905653] ---------ethereum-------------
            2018-07-18 09:56:42.686064-0300 xxx[7771:905653] {"balance":"122"}
            2018-07-18 09:56:42.686382-0300 xxx[7771:905653] ----------DATA------------
            2018-07-18 09:56:42.686638-0300 xxx[7771:905653] {"foreground":true,"ethereum":"{\"balance\":\"122\"}"
,"google.c.a.e":"1","coldstart":false,"gcm.message_id":"0:1531918599095597%9e967f149e967f14"}
            2018-07-18 09:56:42.686851-0300 xxx[7771:905653] ----------notification------------
            2018-07-18 09:56:42.693844-0300 xxx[7771:905653]
     {"additionalData":{"foreground":true,"ethereum":"{\"balance\":\"122\"}","google.c.a.e":"1","coldstart":false,"gcm.message_id":"0:1531918599095597%9e967f149e967f14"},"message":"xxx","title":"tittle","sound":"default"}

0 个答案:

没有答案