-Code i verwendet, um die Liste für das Abrufen nach etwas suchen zu tun ist unterholen Freundesliste von Facebook sdk 4.0.1 in Android mit Graph api 2.2
GraphRequestBatch batch = new GraphRequestBatch(
GraphRequest.newMyFriendsRequest(
accessToken,
new GraphRequest.GraphJSONArrayCallback() {
@Override
public void onCompleted(
JSONArray jsonArray,
GraphResponse response) {
// Application code for users friends
System.out.println("getFriendsData onCompleted : jsonArray " + jsonArray);
System.out.println("getFriendsData onCompleted : response " + response);
try {
JSONObject jsonObject = response.getJSONObject();
System.out.println("getFriendsData onCompleted : jsonObject " + jsonObject);
JSONObject summary = jsonObject.getJSONObject("summary");
System.out.println("getFriendsData onCompleted : summary total_count - " + summary.getString("total_count"));
} catch (Exception e) {
e.printStackTrace();
}
}
})
);
batch.addCallback(new GraphRequestBatch.Callback() {
@Override
public void onBatchCompleted(GraphRequestBatch graphRequests) {
// Application code for when the batch finishes
}
});
batch.executeAsync();
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,link,picture");
und die Erlaubnis erhalte ich ist accessToken: {AccessToken token: ACCESS_TOKEN_REMOVED Berechtigungen: [user_friends, basic_info]}
getRecentlyGrantedPermissions: [user_friends, basic_info]
getRecentlyDeniedPermissions []
und die Ausgabe der Grafikfunktion ist -
Antwort {Reaktion: Response: 200, Graph: { "Zusammenfassung": { "TOTAL_COUNT": 3}, "Daten ": []}, Fehler: null}
so kann mir bitte jemand helfen, die Freundesliste des Benutzers zu holen.
Vielen Dank im Voraus.
können Sie '/ me verwenden/taggable_friends' check this [antwort] (http://stackoverflow.com/a/23417628/5891893) – Sally