I have a NSDictionary called data and when I print using NSLog it gives me:
DATA IS {
aps = {
alert = "aherlambang liked your photo";
badge = 1;
};
"media_id" = "220516456473412852_29088696";
}
I tried to extract the media_id by doing:
NSLog(@"DATA IS %@ MEDIA ID IS %@", userInfo, [userInfo valueForKey:@"media-id"]);
but it always gives me null. Why is this?
Your key in the data is
"media_id", and you’re trying to use the key"media-id".Change
"media-id"to"media_id"and you should be able to read your dictionary.