I am trying to retrieve all the posts, the number of likes on each post, the comments on each post and the number of likes of each comment from a particular FB page (https://www.facebook.com/JnuConfessions). I am using RestFB to do this.
While I have managed to get the post content, comments content and comments likes correctly, I am not able to get the number of likes of any post. I use the following code
Page page = facebookClient.fetchObject("jnuConfessions", Page.class);
Connection<Post> myPagePost = facebookClient.fetchConnection(page.getId() + "/posts", Post.class);
for (List<Post> myFeedConnectionPage : myPagePost) {
for (Post post : myFeedConnectionPage) {
System.out.println ("Number of likes: " + post.getLikesCount());
}
}
However for every post, I just get a null value instead of the correct number of likes.
Is there some way to get the number of likes of each post correctly?