I am developing a iPhone application which get facebook album with this URL https://graph.facebook.com/me/albums?access_token=2227470867|2.ZJr73vaEvFeN4fI_A70RFw__.3600.1297090800-100000566543036|WmgxdwULBgKXl8J7ksGIA1tyGik
Now i want to get photos from this album.
Any Idea will be appreciated.
Thanks in Advance.
Tap. in the bottom right of Facebook, then tap your name. Tap Photos, then tap Albums at the top. Tap the album you'd like to view.
Facebook Single Photo Gallery ID To get the gallery ID simply go to your albums on facebook. Then click on your favorite album. Next you will need to copy the numbers in the url like this.
So /me/albums returns an array of Album objects, each of which has an id
.
If an album had an id of 99394368305, you can go to
https://graph.facebook.com/99394368305/photos
to get an array of photo objects.
Each of these will have the picture
and source
properties to get the image data from facebook.
They will all have an images
array as well if you want pre-scaled images instead of just the originals.
All the facebook queries give JSON back - I'm assuming that you know how to parse this?
It takes lot of time because of following steps;
1) get uid of friend using :
NSString *urlString=[NSString stringWithFormat:@"https://graph.facebook.com/me/friends?access_token=%@&fields=id,picture,name,birthday",fbGraph.accessToken];
2) put friends uid to get album id:
NSString *urlString1=[NSString stringWithFormat:@"https://graph.facebook.com/%@/albums?access_token=%@",obj.uid,fbGraph.accessToken];
NSString *album = [[[_response1 objectForKey:@"data"]objectAtIndex:j]objectForKey:@"name"];
if ([album isEqualToString:@"Profile Pictures"])
{
albumid = [[[_response1 objectForKey:@"data"]objectAtIndex:j]objectForKey:@"id"];
}
3) then put the album id to get the picture from that album:
NSString *albumUrl=[NSString stringWithFormat:@"https://graph.facebook.com/%@/photos?type=album&access_token=%@",albumid,fbGraph.accessToken];
NSString *picUrl=[[[[[_response2 objectForKey:@"data"]objectAtIndex:0]objectForKey:@"images"]objectAtIndex:0]objectForKey:@"source"];
Kindly tell me some other method to get profile picture with large size in a single step to save time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With