I want to get all the photos posted by user in facebook using spring social facebook. I am able to get connected and able to retrieve user name and id, but when i am trying to retrieve album of photos, i am getting zero result . I tried using FQL operations and graph api. following is my code which i am using for getting album.
PagedList<Album> albums = facebook.mediaOperations().getAlbums();
System.out.println(facebook.mediaOperations().toString());
System.out.println(facebook.GRAPH_API_URL);
// System.out.println(albums.size());
// List<Photo> images = new ArrayList<Photo>();
// for (Album album : albums) {
// images.addAll(facebook.mediaOperations().getPhotos(album.getId()));
// }
String query = "SELECT pid, src, src_small, src_big, caption FROM photo WHERE owner= me()";
List<Image> images = facebook.fqlOperations().query(query,
new FqlResultMapper<Image>() {
public Image mapObject(FqlResult result) {
Image image = new Image();
image.setPid(result.getString("pid"));
image.setSrc(result.getString("src"));
image.setSrc_small(result.getString("src_small"));
image.setSrc_big(result.getString("src_big"));
return image;
}
});