iOS facebook sdk how to download album, profile photos data

I would like to allow my iPhone App users to view and select from their facebook profile photos, download the photo to use as a profile pic. I am currently using the Facebook SSO SDK and successfully logging in and accessing Graph information. Have tried to access photo information (after successful SSO login) using

[facebook requestWithGraphPath:@"me/albums"];

but I just get an empty data object in return. I’ve tried using the Facebook API explorer, which is very helpful, and it does give me data for /picture and /photos and /albums. For some reason I don’t get the same data using requestWithGraphPath with me/albums, me/picture or me/photos. Just plain “me” works fine but doesn’t give me any picture info. Can anybody tell me what I’m doing wrong?

  • How to add keychain sharing feature to App ID without device?
  • Swift implementation of FBSDKAppInviteDialogDelegate not working
  • Passing user location to MKMapItem
  • Firebase: Can I use Facebook's new Account Kit to authenticate app users?
  • App crashes in iOS10 after Xcode 8 upgrade, malloc error returned
  • You are not logged in. Please log in and try again
  • Note: this is the API reference: Facebook Graph API

    I did get picture profile to work like this:

    [facebook requestWithGraphPath:@"me?fields=picture"];

    Update: really I want all of the Profile Photos which is a photo album so I need to know how to access albums through iOS. The profile picture I have successfully obtained now.

    I have added permissions “user_photos” and “friends_photos” for photo albums according to API:

        NSArray *permissions = [[NSArray alloc] initWithObjects:
        [facebook authorize:permissions];

    When I say I’m getting empty data, this is the JSON result (in request:didLoad:) that gets returned:

        data =     (

    From my log file output:

    - (void) request:(FBRequest *)request didLoad:(id)result{

    Final Note: What finally worked was to use another device, which updated my permissions and then everything started working! My best guess is that the emulator and my iPhone were not updating my facebook permissions so I was being denied access to photos and getting an empty data array.

    This SO question was a big help also: How to get photos of a facebook album in iPhone SDK?

    2 Solutions Collect From Internet About “iOS facebook sdk how to download album, profile photos data”

    For the sake of future viewers, I’m putting the answer to my own question since I haven’t received a complete answer from anyone else.

    First, you must have the right permissions, either "user_photos" or "friends_photos". Then you have to make sure that your test device updates your permissions — I think restarting the device is what ultimately did it for me.

    Once you’ve done that, you can get the JSON list of albums, after logging in via SSO, using this call:

    [facebook requestWithGraphPath:@"me/albums" andDelegate:self];

    This will give JSON array (under key data) with all kinds of information about each album, including the ID. To get a list of photos for a particular album ID (say its ‘123456789’) do the following:

    NSString * albumId = @"123456789";
    NSString * path = [NSString stringWithFormat:@"%@/photos", albumId];
    [facebook requestWithGraphPath:path andDelegate:self];

    Your response will of course come via the FBRequestDelegate method request:didLoad where you can process the JSON data.

    Download the FBGraph Api documents folder then add it to in your folder. and read the instruction on facebook developer site

    This is the sample code – sample code

    In this you will get a user profile pic in UIAlertView. You can show it where you want.