1

i have tied lot to get the uploaded images fom the facebok to a UITableviewcontroller,but i get the profile picture only.i have a image cropping application which can get images from library,from camera,fromfacebook.so when the user tap the Facebook button,it will authenticate and if the authentication success,it will strive the photos from Facebook to UITableview.Is that possible if yes how to do this.

I do have this code:

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

But I'm not sure What is objectID and where can i get it?

Please help me.Thanks in advance.

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
stackiphone
  • 1,245
  • 3
  • 19
  • 41
  • What exactly does UITableViewController have to do with the question? It looks like you already know how to add photos (i.e. from library) to UITableView. If the question is: "_how to retrieve photos from Facebook_" then write it like that - you'll get much better answers. – Rok Jarc Mar 22 '12 at 14:03
  • And there's a lot of info on this topic here: http://stackoverflow.com/questions/2111002/access-a-facebook-users-photos-and-videos-for-the-iphone, http://stackoverflow.com/questions/4921945/how-to-get-photos-of-a-facebook-album-in-iphone-sdk, http://stackoverflow.com/questions/4909171/how-to-use-facebook-photos-in-an-iphone-app – Rok Jarc Mar 22 '12 at 14:06
  • @rokjarc hi, i am having this code to retrieve photo from Facebook,but what is objectID? NSString *url = [[NSString alloc] initWithFormat:@"https://graph.facebook.com/%@/picture",objectId]; UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]]; – stackiphone Mar 22 '12 at 14:10
  • I don't really know Facebook API but if i understand http://stackoverflow.com/questions/4921945/how-to-get-photos-of-a-facebook-album-in-iphone-sdk correctly you first have to get array of album objects (/me/albums) and they cointain some kind of objectID. – Rok Jarc Mar 22 '12 at 14:22
  • I edited your question a bit - hope you don't mind. This way it might be easier for others to answer it. – Rok Jarc Mar 22 '12 at 14:24
  • I Strongly recommend you to use [Three20](http://three20.info/) – Janub Mar 22 '12 at 14:25
  • @rokjarc thanks for editing my question,but still didnt get the correct help .. – stackiphone Mar 22 '12 at 14:29
  • Have some patience - only 14 people saw your question till now. i added an answer which should work (you will still have to do some research/work, it's not just copy-paste). And also take a look at Three20 as iYaniv is suggesting. – Rok Jarc Mar 22 '12 at 14:32
  • @rokjarc yeaaa,i am watching you answer,,,let me check wether its work or not..... – stackiphone Mar 22 '12 at 14:34

1 Answers1

2

First you have to get album objects.

How to do that is here: fetching facebook albums from an IOS app

Once you have album objects - each of them contains array of photo objetcs (IDs).

Please take a look at deanWombourne's answer at How to get photos of a facebook album in iPhone SDK?.

And from there on your code should work just fine.

Community
  • 1
  • 1
Rok Jarc
  • 18,765
  • 9
  • 69
  • 124