Is there a way to retrieve a specific value from the JSON string below? I am trying to extract the nested object "FromUserId": "bd079f57"
and then pass it to a Javascript function.
"notification":{
"title" :"Test",
"message" : "Message",
"android": {
"data": {
"priority": "2",
"profile": "profile",
"message": "xxx has sent you a Message.",
"style": "inbox",
"noteId": "1",
"visibility": "1",
"title": "Test",
"badge": "12",
"FromUserId": "bd079f57"
}
}
}
"onNotification": function (notification) {
var obj = JSON.parse(notification.message.android.data.FromUserId);
// How do I pass this FromUserId value to the ReadData function?
ReadData(obj)
}
$scope.ReadData(obj){
//additional processing steps for the JSON data
}