2015-11-04 115 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中,回覆包含了所有人的朋友。

而且,沒有,如果你想問,沒有解決方法。

相關問題