1

https://github.com/GrioSF/AndroidFBPhotoPicker
I am Using Above Code for reference but demo is also returning same response (no values for album)

Thanks in advance...

Neeru Jain
  • 153
  • 8
  • see my answer...this is for ios...but you helped lot of...follow 7 step then find your android code...http://stackoverflow.com/questions/30207465/ios-facebook-album-photos-picker/31789234#31789234 – Maulik shah Oct 25 '15 at 15:29
  • if you have any query i will help you – Maulik shah Oct 25 '15 at 15:29

1 Answers1

1

I use the following code to fetch album from Facebook and it works for me.

LoginButton loginButton=new LoginButton(MainActivity.this);
loginButton.setReadPermissions("email", "user_friends","user_photos");
loginButton.performClick();//call this method to your button click

private FacebookCallback<LoginResult> callback = new FacebookCallback<LoginResult>() {
    @Override
    public void onSuccess(LoginResult loginResult) {
    GraphRequest request = GraphRequest.newMeRequest(
           loginResult.getAccessToken(),
           new GraphRequest.GraphJSONObjectCallback() {
               @Override
               public void onCompleted(
                       JSONObject object,
                       GraphResponse response) {
                   try {
                     // parse your JSON here....


                   } catch (JSONException e) {
                       e.printStackTrace();
                   }

               }
           });

        Bundle parameters = new Bundle();
        parameters.putString("fields", "id,name,email,gender, birthday,albums");
        request.setParameters(parameters);
        request.executeAsync();
        AccessToken accessToken = loginResult.getAccessToken();


    }

    @Override
    public void onCancel() {

    }

    @Override
    public void onError(FacebookException e) {

    }
};
sumit singh
  • 588
  • 1
  • 5
  • 20