我在解析下面的 Moengage 通知响应时遇到问题
从:
-(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 );
}
}
日志:
Moengage 通知:与上述响应相同
管理应用程序(空)
Moenage 应用程序(空)
摩纳哥:
{
screenData = {
"" = "";
};
screenName = "";
}
现在我的问题是我正在尝试检索“ aps = { alert = "iOS Test ";" ..但这不是 JSON ..任何人都可以建议我解析这个响应或者是他们 从这个响应中检索“iOS 测试”的方式