I am getting an issue in parsing Moengage notification response which is below from
From:
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
{
NSLog(@"notification appdelegate %@",userInfo);
[self customPushHandler:userInfo];
}
notification app delegate:
{
"app_extra" = {
screenData = {
"" = "";
};
screenName = "";
};
aps = {
alert = "iOS Test ";
badge = 1;
"content-available" = 0;
sound = default;
};
moengage = {
"" = "";
cid = ;
};
}
- (void) customPushHandler:(NSDictionary *)notification {
if (notification !=nil && [notification objectForKey:@"app_extra"] != nil) {
NSDictionary* app_extra_dict = [notification objectForKey:@"app_extra"];
NSDictionary* app_extra_dict1 = [[notification objectForKey:@"app_extra"]objectForKey:@"aps"];
NSDictionary* app_extra_dict2 = [[notification objectForKey:@"aps"];
NSLog(@"Moenage notification %@",notification);
NSLog(@"Menage apps %@",app_extra_dict1);
NSLog(@"Moenage apps %@",app_extra_dict2);
NSLog(@"Moenage %@",app_extra_dict );
}
}
Log:
Moengage notification :Same as above response
Menage apps (null)
Moenage apps (null)
Moenage:
{
screenData = {
"" = "";
};
screenName = "";
}
Now my issue is I am trying to retrieve " aps = { alert = "iOS Test ";" ..But this not is JSON..can any please suggest me to parse this response or is their way to retrieve "iOS test" from this response
Console:
2016-01-29 12:28:06.613 json iOS Test