【问题标题】:Can't tag friends on uploading photo to user wall - Facebook iOS无法在将照片上传到用户墙时标记朋友 - Facebook iOS
【发布时间】:2012-10-06 19:16:11
【问题描述】:

我在将照片和标签用户的朋友上传到 Facebook 用户的墙上时遇到问题。它返回未知错误

如果我删除 tags 参数,它将完美运行。

这是我用来发布照片和标记用户的代码

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];

请帮我解决这个问题,感谢所有想法。

谢谢

【问题讨论】:

  • 这个问题有解决方案吗,如果有,请与我分享....

标签: post tags photo facebook-ios-sdk


【解决方案1】:

从 facebook 开发者帐户查看此链接。对我来说效果很好,如果您愿意,请先尝试一下,我也可以提供代码。

FaceBook Docs Here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多