iOS Facebook Graph API Profile picture link

懵懂的女人 提交于 2019-11-27 15:33:50

make the graph request:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"picture",@"fields",nil];
[facebook requestWithGraphPath:@"me" andParams:params andDelegate:self];

then on request didLoad:

NSString *pictureUrl = [result objectForKey:@"picture"];

If you want additional fields, just add them to the params dictionary:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"id,name,picture",@"fields",nil];

After logged in you can get the profile picture with this link;

https://graph.facebook.com/userId/picture?width=640&height=640

Do you meen anything like the following?

NSString *fbuid = @"1234567890";
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture", fbuid]];

Or do you need the final url to which the link above redirects you? For the final url I guess you will need a proxy, something of this kind maybe.

UPDATE:
You can also get the link with FQL: https://developers.facebook.com/blog/post/2012/04/11/platform-updates--operation-developer-love/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!