0

我正在使用 facebook4j 从 facebook 网页上的相册中获取照片,以便在我的网站上制作画廊。

但是,我一次不能获得超过 25 张照片(即使相册中有更多照片并且计数正确(album.getCount())。

我尝试使用 reading.limit() 但没有成功...是硬限制为 25 还是我做错了什么?

if(null != facebookAlbum) {
            Reading reading = new Reading();
            reading.limit(100);
            ResponseList<Photo> photoResults = facebook.getAlbumPhotos(facebookAlbum.id, reading);
            Iterator<Photo> photoItr = photoResults.iterator();
            List<FacebookImage> facebookImages = new ArrayList<FacebookImage>();
            while(photoItr.hasNext()) {
                Photo photo = photoItr.next();
                FacebookImage facebookImage = new FacebookImage();
                facebookImage.imageUrl = photo.getSource().toString();
                facebookImage.album = facebookAlbum;
                facebookImages.add(facebookImage);
            }
        }
4

1 回答 1

0

Try this

ResponseList<Photo> photoResults = facebook.getAlbumPhotos(facebookAlbum.id, reading.limit(0));

setting limit to 0 gets all the images.. Refer to this link for more.

于 2015-04-02T17:11:21.323 回答