如何在Android中获取facebook好友列表?

时间:2018-01-04 04:58:24

标签: android facebook

Code:


 AccessToken.getCurrentAccessToken(),
                                "/"+fbUserid+"/friendlists",
                                null,
                                HttpMethod.GET,
                                new GraphRequest.Callback() {
                                    public void onCompleted(GraphResponseresponse) {
 Log.e("friendsRes",response.toString());        
                                    }}).executeAsync();
  

{响应:responseCode:200,graphObject:{“data”:[]},错误:null}

在这段代码中,我无法在Android中获取好友列表,还有facebook朋友的任何其他代码过滤器。谢谢!

1 个答案:

答案 0 :(得分:-1)

new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{friend-list-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();

注意:需要具有read_custom_friendlists权限的用户访问令牌。