iOS Facebook Graph API个人资料图片链接

sam*_*ami 9 profile facebook image facebook-graph-api ios

我正在尝试检索配置文件图片的链接...到目前为止图形API调用:

[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
Run Code Online (Sandbox Code Playgroud)

将图像本身作为数据返回.当我打电话时:

[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
Run Code Online (Sandbox Code Playgroud)

我确实得到了一个包含每个链接的图片.反正有没有为个人资料图片获得某种类似的东西,至少只是链接...或者它不可能吗?如果有人已经通过这个,请告诉我.

干杯,

萨米.

Joe*_*oel 12

制作图表请求:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"picture",@"fields",nil];
[facebook requestWithGraphPath:@"me" andParams:params andDelegate:self];
Run Code Online (Sandbox Code Playgroud)

然后根据要求didLoad:

NSString *pictureUrl = [result objectForKey:@"picture"];
Run Code Online (Sandbox Code Playgroud)

如果您想要其他字段,只需将它们添加到params字典:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"id,name,picture",@"fields",nil];
Run Code Online (Sandbox Code Playgroud)


Ali*_*söz 9

登录后,您可以通过此链接获取个人资料照片;

https://graph.facebook.com/userId/picture?width=640&height=640
Run Code Online (Sandbox Code Playgroud)


bor*_*kur 4

您的意思是类似以下内容吗?

NSString *fbuid = @"1234567890";
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture", fbuid]];
Run Code Online (Sandbox Code Playgroud)

或者您需要上面的链接将您重定向到的最终网址吗?对于最终的网址,我想您将需要一个代理,也许是这种类型的东西

更新:
您还可以获取 FQL 的链接: https ://developers.facebook.com/blog/post/2012/04/11/platform-updates--operation-developer-love/