我在将照片和标签用户的朋友上传到 Facebook 用户的墙上时遇到问题。它返回未知错误
如果我删除了标签参数,它将完美运行。
这是我用来发布照片和标记用户的代码
NSMutableArray *chunks = [[NSMutableArray alloc] init];
NSMutableDictionary *tagDict=[[NSMutableDictionary alloc]init];
for(int i=0; i < appDelegate.listFriend.count ;i++) {
NSDictionary *friend = [appDelegate.listFriend objectAtIndex:i];
NSString *type = [NSString stringWithFormat:@"%@",[friend objectForKey:@"type"]];
if([type intValue] == 1) {
[tagDict setValue:[friend objectForKey:@"id"] forKey:@"tag_uid"];
[chunks addObject:tagDict];
}
}
[photoParams setObject:[chunks JSONString] forKey:@"tags"];
//test posting facebook's image's url
NSString *imagePath = urlPhoto;
NSURL *imageUrl = [NSURL URLWithString:imagePath];
NSData *imageData = [NSData dataWithContentsOfURL:imageUrl];
NSMutableDictionary *photoParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
message, @"message", imageData, @"source", nil];
[appDelegate.facebook requestWithGraphPath:@"/me/photos" andParams:photoParams andHttpMethod:@"POST" andDelegate:appDelegate.self];
请帮我解决这个问题,感谢所有想法。
谢谢