It takes a lot of time due to the following steps;
1) get the friend uid using:
NSString *urlString=[NSString stringWithFormat:@"https://graph.facebook.com/me/friends?access_token=%@&fields=id,picture,name,birthday",fbGraph.accessToken];
2) set 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 a snapshot from this 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"];
Tell me another way to get a large profile picture in one step to save time.
Engr Irfan Ali
source share