Who can take a look at my code, I’m trying to get a data inside an object, but it’s impossible. and it does not make any sense, I’m seeing the object ethereum and inside the ethereum object I have a variable called balance, but I can not get into it at all
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);
Postman
`
"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"}