I am trying to retrieve the link to the profile picture...
So far the graph API call :
[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
returns the image itself as Data. When I make the call :
[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
I do get an array of picture with the link for each of them.
Is there anyway to get some sort of similar thing for the profile pic, at least just the link... Or is it not possible?
If someone has already been through this please let me know.
Cheers,
Sami.
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/