How to get body and title data from the below response. I'm totally stuck
[aps: {
alert = {
body = test123;
title = test123;
};
},
gcm.message_id: 0:4a]
If you are working with notification then you need to access the data like this way.
if let info = notification.userInfo as? [String: AnyObject],
let apsDic = info["aps"] as? [String: AnyObject],
let alertDic = info["alert"] as? [String: AnyObject] {
if let body = alertDic["body"] as? String {
print(body)
}
if let title = alertDic["title"] as? String {
print(title)
}
}
print(dict)?