Мне нужен пользователь (или хотя бы его идентификатор), который оставил комментарий в сообщении.
Это Java-приложение для рабочего стола.
Я получил токен доступа и выбрал все разрешения, только для тестирования.
Я пытался безуспешно:
com.restfb.types.Page fetchedPage = facebookClient.fetchObject(pageName, com.restfb.types.Page.class);
//String pageID = fetchedPage.getId();
//String postID = "some post id from the 'fetchedPage'"
String postParam = "type,from,created_time,message,likes.summary(true),comments.order(chronological).summary(true){from{id}}";
com.restfb.types.Post fetchedPost = facebookClient.fetchObject(pageID + "_" + postID, com.restfb.types.Post.class, com.restfb.Parameter.with("fields", postParam));//the part 'from' of the 'comments' don't work as expected, returns null, that > "comments.order(chronological).summary(true){from{id}}"
com.restfb.types.Comments postComments = fetchedPost.getComments();
if(postComments != null){
for(com.restfb.types.Comment comment : postComments.getData()){
if(comment != null){
//curiously I can not access the user who made the comment, but if it is a page that made a comment in the post it perfectly returns the user (which is a page)
System.out.println("comment: " + comment.getFrom());// >> 'getFrom()' is null << that is what I need, the or at least the ID as told before.
com.restfb.types.Comment fetchedComment = facebookClient.fetchObject(pageID + "_" + comment.getId(), com.restfb.types.Comment.class, com.restfb.Parameter.with("fields", "from,id,message,created_time,like_count,comment_count"));
System.out.println("fetchedComment: " + fetchedComment);//fetching like that the 'getFrom()' is null too...
System.out.println();
}
}
}
Есть подсказка?
Извините за плохой английский