Home How to get Facebook Photos Url in login Response?
Reply: 1

How to get Facebook Photos Url in login Response?

Atendra Singh
1#
Atendra Singh Published in 2018-02-13 15:28:28Z

I am getting Ids of photos and i want to have the urls for that see my code below.

 callbackManager = CallbackManager.Factory.create();
    LoginManager.getInstance().registerCallback(callbackManager, 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) {
                            parseFbResponse(object);
                        }
                    });

            Bundle parameters = new Bundle();
            parameters.putString("fields", "id,name,email,birthday,work,about,photos.limit(6){link}");
            request.setParameters(parameters);
            request.executeAsync();

Response -

{}photos
  []data
    {}0
      created_time : "2017-12-25T07:04:31+0000"
      name : "♥️♥️♥️♥️😘😘😘😘😘"
      id : "2534011966656881"
Amardeep
2#
Amardeep Reply to 2018-02-14 07:23:27Z
  /* make the API call */
    new GraphRequest(
        AccessToken.getCurrentAccessToken(),
        "/{photo-id}",
        null,
        HttpMethod.GET,
        new GraphRequest.Callback() {
            public void onCompleted(GraphResponse response) {
                /* handle the result */
            }
        }
    ).executeAsync();

Please refer to graph api documentation for further references on photo element. https://developers.facebook.com/docs/graph-api/reference/photo/

https://developers.facebook.com/docs/graph-api/reference/user/photos/

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.313225 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO