从Facebook的图库中获取图像并在iPhone中显示



我想从Facebook的公共执行中获取图像并在我的iPhone中显示它。我正在使用Facebook开发者方法"getPhoto",但我不能显示任何图像?

有人能帮帮我吗?

 NSString *url = [[NSString alloc] initWithFormat:@"https://graph.facebook.com/%@/picture",objectID];
 UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];

如前所述,您的问题是检索对象id。解决方案是:-找回你朋友的照片。使用url

创建连接
 NSString *url = [[NSString alloc] initWithFormat:@"https://graph.facebook.com/me/friends?access_token=%@",accessTokenValue];

上面的url,当点击返回一个数组的字典,其中你的朋友的名字和他的id写入。只要Json解析就能得到这个人的id

你需要使用图形API来实现这个目的

 NSString *url = [[NSString alloc] initWithFormat:@"https://graph.facebook.com/%@/picture",objectID];
 UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];

最新更新