2015-11-04 112 views
0

我想取下面如何通过新图api,v2.5获得Facebook电子邮件的朋友列表?

GraphRequest request = GraphRequest.newMyFriendsRequest(
       token, 
       new GraphRequest.GraphJSONArrayCallback() { 
        @Override 
        public void onCompleted(JSONArray array, GraphResponse response) { 
         // Insert your code here 
        } 
       }); 
     request.executeAsync(); 
    } 

响应代码执行后返回使用的代码好友列表是

{Response: responseCode: 200, graphObject: {"data":[],"summary":{"total_count":461}}, error: null} 

Persmission到access friendspublic profile被授予登录时间。 我如何获取我的朋友列表和他们的公共电子邮件/ Facebook电子邮件?

回答

2

可以使用图形的API调用

/* make the API call */ 
new GraphRequest(
    AccessToken.getCurrentAccessToken(), 
    "/me/friends", 
    null, 
    HttpMethod.GET, 
    new GraphRequest.Callback() { 
     public void onCompleted(GraphResponse response) { 
      /* handle the result */ 
     } 
    } 
).executeAsync(); 

recive你的朋友列表,但限制是

  1. API与user_friends许可所需的访问令牌
  2. 只返回的朋友谁也定接入对同一个应用程序的许可 使用

https://developers.facebook.com/docs/graph-api/reference/v2.5/user/friends

3

时,才会收到whcih也在使用您的应用程序的朋友,看到

/me/friends回报用户的朋友谁也使用你的应用程序 在V2.0 ,朋友API终端会返回也在使用您的应用的朋友的列表。在v1.0中,回复包含了所有人的朋友。

而且,没有,如果你想问,没有解决方法。

相关问题