Uploaded image for project: 'Spring Social Facebook'
  1. Spring Social Facebook
  2. SOCIALFB-200

Allow Nested Requests in Facebook API

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: API Binding
    • Labels:
      None

      Description

      Facebook Graph allows nested requests for any request.

      GET graph.facebook.com
        /{node-id}?
          fields=<first-level>{<second-level>}
      

      This opperation cant be done with spring social. For instance, when i try to get all posts from an user with it respectively likes.
      There's no space in API to bind extra nested request:

      getConnection().getApi().feedOperations().getPosts(pageParams);
      

      I also can't use the fetchConnections from FacebookTemplate because an exception is thrown when retrieving nested objects. For example, the code:

      		PagedList<FacebookPost> posts = 
      				getConnection().getApi().fetchConnections("me", "posts", FacebookPost.class, 
      						"likes," + Arrays.asList(IPost.ALL_POST_FIELDS).stream().collect(Collectors.joining(",")));
      

      Generates this exception:

      com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
       at [Source: [email protected]; line: 1, column: 2612] (through reference chain: java.util.ArrayList[1]->com.roberto.social.domain.FacebookPost["likes"])
      

        Attachments

          Activity

            People

            Assignee:
            habuma Craig Walls
            Reporter:
            robertobsc Roberto Barros da Silva Costa
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: