获取Facebook朋友的个人资料详细信息 [英] Getting Facebook friends profile details

查看:211
本文介绍了获取Facebook朋友的个人资料详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用facebook4j API.我想获取朋友的个人资料详细信息,例如教育,就业等.目前,我所得到的只是姓名和性别. 即使我按照

I am using facebook4j API. I want to get the profile details of my friends like education ,employement etc. Buit what I get currently is name id and gender only. Even though I gave all the extended_permissions for my friends like friends_education_history etc as per given in the url

到目前为止,我仍未获得我朋友的完整个人资料详细信息.我将如何实现这一目标

Still now I am not getting my friends full profile details. How would I achieve this

 ResponseList<Friend> friends = facebook.getFriends();

是否可以选择获取公开简介的教育和工作经历?

Is there any option to get the education and work history of public profile?

推荐答案

我从未使用过Facebook4j API,但是我可以尝试以下方法. Friend实现User,因此您可以在Friend对象上使用User方法.

I have never used the Facebook4j API but here is what I would try. Friend implements User so you can use the User methods on your Friend objects.

ResponseList<Friend> friends = facebook.getFriends();

for (Friend facebookFriend : facebookFriends) {
    List<Education> educations = facebookFriend.getEducation();
    for (Education e : educations) {
        /* do anything with the Education object */
        System.out.println("School: " + e.toString());
    }

    List<Work> works = facebookFriend.getWork();
    for (Work w : works) {
        /* do anything with the Work object */
        System.out.println("Work: " + w.toString());
    }
}

文档:

  • The User object and its methods.
  • The Education object and its methods.
  • The Work object and its methods.

这篇关于获取Facebook朋友的个人资料详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆