开发者

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

开发者 https://www.devze.com 2023-03-18 07:53 出处:网络
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.

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 *photoAlb开发者_如何学PythonumArray=(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.


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.


I just figured how to query all the images in an album without knowing how many photos are there: just pass "0" (ALBUM_ID/photos?limit=0)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号