我正在使用带有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/