John Smith
John Smith

Reputation: 2022

Getting a larger Facebook profile picture and personal data at a time

Please help getting a larger profile picture from Facebook. My method below returns a link to a tiny one.

- (void)openSession{

    NSArray *permissions = [NSArray arrayWithObject:@"email"];
    NSDictionary *parameters = [NSDictionary dictionaryWithObject:
                                @"picture,email,name,username,location,first_name,last_name"
                                                           forKey:@"fields"];
    [FBSession openActiveSessionWithReadPermissions:permissions
                                       allowLoginUI:YES
                                  completionHandler:^(FBSession *session,
                                                      FBSessionState state,
                                                      NSError *error) {
                                      if (session.isOpen) {
                                          [FBRequestConnection startWithGraphPath:@"me" parameters:parameters
                                                                       HTTPMethod:@"GET"
                                                                completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {

                                                                    //save personal details using "id result"
                                                                    [...saving method here...]
                                                                    //manage session
                                                                    [self sessionStateChanged:session state:state error:error];
                                                                }];
                                      }
                                  }];
}

I have also found this way: if following this link in a web browser, I can get the image larger (the bla-bla-bla is my Facebook id:)))

http://graph.facebook.com/92875029-bla-bla-bla-84538042/picture?type=large

But it looks like the link above leads to a redirect page, cos' after the image is loaded, the link is changed to :

http://profile.ak.fbcdn.net/hprofile-ak-snc6/1864-bla-bla-bbla-bla482_n.jpg

Well, never mind, I cannot use it in my method above anyway.

So actually I am getting the profile picture, but as I said, it's small.

Please help getting it larger, but within my used method. Many thanks in advance

Upvotes: 0

Views: 664

Answers (1)

sinisterfrog
sinisterfrog

Reputation: 536

Change your parameters to:

@"picture.type(large),email,name,username,location,first_name,last_name"

Upvotes: 2

Related Questions