gpt4 book ai didi

java - Facebook4J friend 专辑照片

转载 作者:太空宇宙 更新时间:2023-11-04 14:12:49 25 4
gpt4 key购买 nike

我正在使用带有Processing/Java的Facebook4J,并且我正在尝试提取 friend 照片的信息。几个月前我使用过该代码,它运行良好,但现在它返回所有字段为 null。有人可以帮助解决这个问题吗?以下是我提取照片的方法:

  User fbUser = facebook.getUser(userID);
ResponseList<Album> albums = facebook.getAlbums(userID);
String targetAlbumId = "";
imgArray = new ArrayList<PImage>();

for (Album album : albums) {
//Get the album ID if it matches the string
if (album.getName().equals("Cover Photos")) {
targetAlbumId = album.getId();
break;
}
}

//Get all the photos that correspond to that Album ID
//Create a string arraylist to store all the photo ID names
ResponseList<Photo> photos = facebook.getAlbumPhotos(targetAlbumId);
ArrayList<String> getPhotoId = new ArrayList<String>();

//Get all photos in high quality. Create an arraylist of all the photos,
//and an arraylist of all the photo IDs (to use later for getting their likes)
for (Photo photo : photos) {
URL highQuality = photo.getImages().get(0).getSource();
imgArray.add(loadImage(highQuality.toString()));
getPhotoId.add(photo.getId());
}

最佳答案

当您的应用使用 Graph API v2.0 或更高版本时,您将无法再访问 friend 的照片。

查看

All friends_* permissions have been removed.

关于java - Facebook4J friend 专辑照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28089927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com