Search code examples
iphonearraysfacebookfacebook-graph-apiphotos

Facebook requestWithGraphPath:@"ALBUM_ID/photos" not returning the entire album


Could you tell me why this request is only returning a partial number of the photos in the album? Because I have an album with 99 photos and only 25 are getting returned in the array it produces.

I call the request with this code:

-(IBAction)showAlbum:(UIButton *)sender
{
    //Go goes here to get an album and display it in the UIScrollView
    [_facebook requestWithGraphPath:@"ALBUM_ID/photos" andDelegate:self];    
}

And I get the array of photos using this code:

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

    //Code for array of photos
    NSArray *photoAlbumArray=(NSArray*)[result valueForKey:@"data"];
    [self.label setText:[NSString stringWithFormat:@"%i", [photoAlbumArray count]]];
}

The label should read "99" but instead it reads "25". Additionally when I load the photos from the array only 25 photos appear.


Solution

  • Most facebook graph api calls have a default limit of 25 items returned and support limit and offset parameters. You could request ALBUM_ID/photos?limit=100 instead.