I have this snippet
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
Bundle bundle = new Bundle();
bundle.putString("fields", "birthday");
mAsyncRunner.request("me/friends", bundle, new FriendListRequestListener());
and it works somehow, I mean I can read the ids from all my friends.
But in I want to read everything how can I do that ?
String _error = null;
JSONObject json = Util.parseJson(response);
final JSONArray friends = json.getJSONArray("data");
for (int i = 0; i < friends.length(); i++) {
Log.v("id:", "id= "+friends.get(i).toString());
}
What should I do to get info about my friends and to read that info
I guess this is the key, this is from the example I found and it works fine
bundle.putString("fields", "birthday");
but when I put for example, doesn’t works
bundle.putString("fields", "friends_relationships");
—————–EDIT 1————————-
code for permissions
mFacebook.authorize(Example.this, new String[] {"offline_access", "user_interests", "friends_interests","friends_relationships","friends_relationship_details"},new DialogListener() {
@Override
public void onComplete(Bundle values) {}
@Override
public void onFacebookError(FacebookError error) {}
@Override
public void onError(DialogError e) {}
@Override
public void onCancel() {}
});
————– EDIT 2 ————–
{“error”:{“message”:”An active access token must be used to query information about the current user.”,”type”:”OAuthException”,”code”:2500}}
Graph API is the smart choice in most cases. To retrieve your friend information you need to collect some extended permissions from the user first. Then you can retrieve a lot more information other than the basic ones.
Following is a list of extended permissions related to friends different kind of information
facebook.authorize(this, new String[] {"offline_access", "user_interests", "friends_interests"},Edit :-
Look at here for more details.
Edit :-