2
I have the following json
{"message": "457896","additionalData":{"google.message_id":"0:149534266","coldstart":false,"collapse_key":"com.ionicframework.lucasteste693113","foreground":true}}
How can I give an Alert to show all information ?
I’m wanting to show all the information I tried to do so:
.controller('principalController', function($http, $scope, $sce, $stateParams, $ionicScrollDelegate, $timeout, $rootScope, $cordovaPushV5) {
$rootScope.$on('$cordovaPushV5:notificationReceived', function(event, notification){
// esse nao veio
alert("result: " + JSON.stringify(notification.message) + JSON.stringify(notification.additionalData.google.message_id));
//{"message": "457896","additionalData":{"google.message_id":"0:149534266","coldstart":false,"collapse_key":"com.ionicframework.lucasteste693113","foreground":true}}
});
})
and but I don’t function someone could help me?
I tried again with JSON.stringify and without it with this same I put, without the quotes but I do not work. No message appeared.
– Lucas Santos
I made this example using the very json you posted: https://jsfiddle.net/joserogerio84/L51kpnr8/
– joserogerio84
Thank you so much for helping I was able to do it this way : Alert("result: " + JSON.stringify(notification.message) + JSON.stringify(notification.additionalData["google.message_id"])); And I work in Alert.
– Lucas Santos