1

I'm working on an Android version of an app that uses Facebook for authorization and for retrieving user's friend list.

As of SDK v.2.0, it became pretty hard to get list of friends that hadn't installed your app, but I made it work and now I need to get links to friends profile pictures (avatars). But Facebook does not want to return normal IDs for friends that haven't installed the app. For example, if a friend installed an app then FB returns its ID as digits, something like this 651651616851, and if not then FB returns string of chars like "glkjrgbdjrbgjdrbhgjhLFKBfEFbFkjgnrg".

If I use digit-like ID to retrieve photo, it works, but if I try to use charlike ID, FB returns an 803 error.My question is how do I get normal IDs or how to get friends profile pictures?

Daniel
  • 2,355
  • 9
  • 23
  • 30
Arthur
  • 769
  • 7
  • 17
  • Check [this](http://stackoverflow.com/a/32311187/6005977). It'll help you – Ankita Shah Dec 15 '16 at 10:54
  • So you used taggable_friends or invitable_friends to get the list of friends? Those endpoints are for the very specific purpose their names indicate; you are not allowed to use them for any other purpose. Facebook will reject your app’s use of those in review. Facebook introduced these imitations for a reason - don’t try and circumvent them. – CBroe Dec 15 '16 at 11:54

2 Answers2

1

This is the API call to get the pictures of friends, you can specify a (minimum) width and height:

/me/friends?fields=picture.width(400).height(400)
andyrandy
  • 72,880
  • 8
  • 113
  • 130
0

Please follow the link of facebook sdk about the Track Current Profile.

 FacebookSdk.sdkInitialize(this.getApplicationContext());
    callbackManager = CallbackManager.Factory.create();

    ProfileTracker profileTracker = new ProfileTracker() {
        @Override
        protected void onCurrentProfileChanged(
                Profile oldProfile,
                Profile currentProfile) {
            // App code
               Uri uri = currentProfile.getProfilePictureUri(200,200); 
        }
    };

Now From Uri you can download the profile picture of user current profile.

TejaDroid
  • 6,561
  • 4
  • 31
  • 38