0

I'm trying to get the friends from facebook, but when I'm try with my personal account I get the friends that I have and uses the app. The problem is when I use an other account (this account has my personal account as friend) the app doesn't get the friends.

This is my code:

if (session.isOpened() && hasFriendsPermission()) {
    Request friendRequest = Request.newMyFriendsRequest(session, 
        new GraphUserListCallback(){
            @Override
            public void onCompleted(List<GraphUser> users,
                    Response response) {
                Log.i("INFO", response.toString());// + " - " + users.size());
                friends = users;

                if (friends != null && friends.size() > 0) {
                    if (processTask == null) {
                        processTask = new FriendsProcess();
                        processTask.execute();
                    }
                }
            }
    });
    Bundle params = new Bundle();
    params.putString("fields", "id,name");//,friends");
    friendRequest.setParameters(params);
    friendRequest.executeAsync();
}

And this is the response I'm getting in the other account (the account that's not my personal facebook account):

{Response:  responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 100, errorType: OAuthException, errorMessage: Unsupported operation}, isFromCache:false}

I hope you can help me to fix this, or at least to know why this is happening. Thanks!

1 Answers1

0

When your application is in sandbox/development mode you can not perform any api call for other user. To test your for other user, add the user as a tester, developer or admin. See details https://developers.facebook.com/docs/ApplicationSecurity/

BeingMIAkashs
  • 1,375
  • 11
  • 18