GuilhE February 2016

Facebook Graph API calls not retrieving all fields

I'm requesting my me/albums with:

  new GraphRequest(
        AccessToken.getCurrentAccessToken(),
        "/me/albums",
        null,
        HttpMethod.GET,
        new GraphRequest.Callback() {
            public void onCompleted(GraphResponse response) {
                parseAlbumResponse(response);
            }
        }).executeAsync();

Problem is that the response object only contains 3 fields:

{
  "data": [
    {
      "created_time": "...",
      "name": "...",
      "id": "..."
    },
...

Instead of all fields documented here. Sames goes for /{album-id}/photos:

{
  "data": [
    {
      "created_time": "...",
      "id": "..."
    },
...

Instead of this. It was working last time I've checked but all of a sudden this strange behaviour happened. I've tested with Facebook Graph API and the result it's the same so I guess it's not a problem from my app.

I'm using 'com.facebook.android:facebook-android-sdk:4.7.0'. Did Facebook changed something in the requests parameters?

EDIT: As user luschn suggested:

Declarative Fields

To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.

So I had to change my requests to:
Web conso

Answers


luschn February 2016

https://developers.facebook.com/docs/apps/changelog#v2_4

Search for "Declarative Fields" in the changelog, you have to specify the fields you want to get returned.

Post Status

Asked in February 2016
Viewed 1,566 times
Voted 7
Answered 1 times

Search




Leave an answer