java - Facebook4J friend 专辑照片

标签 java facebook processing

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

相关文章:

java - 当我尝试包含乌尔都语字符串时,为什么会出现编译错误?

java - 如何在 Spring MVC 应用程序中分别处理多个子域?

java - 创建不同对象的实例列表

facebook - 错误代码 100(只能对您的应用程序的有效测试用户调用此方法)

java - 如何通过将颜色更改为红色来显示正在排序的行?

java - 将对象的 Yaml 配置列表添加到属性文件

android - 身份验证 : Facebook user access token validation on server side?

android - 无法保存未经身份验证的 ParseUser

javascript - loadPixels() 不适用于 p5.js

java - 如何在不改变Y坐标的情况下设置X坐标中的鼠标位置