1

I have a graph api call from my ios application. It looks something like this:

[[appDelegate facebook] requestWithGraphPath:[NSString stringWithFormat:@"%i/picture", [[userData objectForKey:@"id"] intValue] andDelegate:self];

(might be some typos)

But in the request did load when i nslog the result, it is (null). Graph API says that you need to use fields=picture or something to get the url. How would I do this? If it is possible could somebody show me some example code?

michaela
  • 173
  • 1
  • 2
  • 13

2 Answers2

2

You don't need an actual Graph API call to load a user's facebook picture. Simply construct a url like this, and it will return the specified user's facebook image:

NSURL *fbPictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://graph.facebook.com/%@/picture", [userData objectForKey:@"id"]];

You can then do with that what you want, like load it in an UIImageView.

Andy Obusek
  • 12,614
  • 4
  • 41
  • 62
0

See my answer on this post to see how to get the picture URL using requestWithGraphPath:

iOS Facebook Graph API Profile picture link

Community
  • 1
  • 1
Joel
  • 15,654
  • 5
  • 37
  • 60