How to get the bigger profile picture of a facebook page How to get the bigger profile picture of a facebook page ios ios

How to get the bigger profile picture of a facebook page


Generally if you want to collect the profile pic of a user or page, the format for the icon size picture is:

http://graph.facebook.com/[page id/profile id]/picture

and for the large picture:

http://graph.facebook.com/[page id/profile id]/picture?type=large

EDIT Points to note:If the image stored on the facebook servers is less than the 200*200 dimensions, you would get the image as the highest resolution avaiable eg: 128*160. Either you can resize it using the GD library.

AND ONE MORE THING

Facebook supports 200*600px as the highest resolution for the profile pic. It will resize an image to fit into these dimensions by maintaining the aspect ratio.

*UPDATE as on 19th Feb, 2017 *

We need to use this new URL formation to get a desired profile image.

http://graph.facebook.com/{profile_id}/picture?width={number‌​}&height={number}

[Thank you https://stackoverflow.com/users/2829128/vay]


If you want to get a larger picture you can just set the height and width you want like this:

http://graph.facebook.com/[page id/profile id]/picture?width=[number]&height=[number]

More info and examples here: Pictures - Facebook Developers


this will also work

picture.type(large)

example

 if ([FBSDKAccessToken currentAccessToken]) {    [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields": @"picture.type(large),name, email"}]     startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {         if (!error) {             NSLog(@"fetched user:%@", result);             NSMutableDictionary *data=[[NSMutableDictionary alloc]init];             data=result;             fbId.text=[data valueForKey:@"id"];             userName.text=[data valueForKey:@"name"];             _emailFB.text=[data valueForKey:@"email"];             NSDictionary *dictionary = (NSDictionary *)result;             NSDictionary *data3 = [dictionary objectForKey:@"picture"];             NSDictionary *data2 = [data3 objectForKey:@"data"];             NSString *photoUrl = (NSString *)[data2 objectForKey:@"url"];             NSLog(@"Photo : %@",photoUrl);         }     }];}

}