FacebookClient fClient = new DefaultFacebookClient(token);
Connection<Post> posts = fClient.fetchConnection(page + "/posts", Post.class);
for (List<Post> page : posts)
{
for (Post post : page)
{
Comments comments = fClient.fetchObject(post.getId() + "/comments", Comments.class, Parameter.with("fields", "message,likes,name,from"));
for (Comment co : comments.getData())
{
if (co.getFrom() == null)
{
continue;
}
System.out.println(co.getFrom().getName());
}
}
}
此功能适用于我的facebook帐户,但如果有人评论getFrom() 返回始终为null。为什么会发生这种情况?