Announcement Announcement Module
Collapse
No announcement yet.
Facebook: How to pack tagging information alongside a photo while posting to my wall? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facebook: How to pack tagging information alongside a photo while posting to my wall?

    Hi guys,

    I have problem passing photo tagging information along a photo my wall in facebook using spring social (using graph api). Facebook docs says that one needs to add to the multi map entry "tags" an array of objects each containing friend Id, friend Name and x and y percentage offsets inside the actual photo.
    See here more details (tags field).
    My code is the following:

    Code:
    MultiValueMap<String, Object> data = new LinkedMultiValueMap<String, Object>();
    data.set("source", photo);
    data.set("message", "My Flying Network Snapshot");
    data.set("tags", taggingData.toArray());
    photoId = facebook.publish("me", "photos", data)
    Without the tag the posting works fine. With it the no matter what variant I tried I get usually the errors from RestClient that there is not HTTPMessageConverter for whatever type I use.
    Usually, tagging data is a List<HashMap<String, Object>> because the value is either String or Double depending on field type. However, it seems to be very difficult (at least for me) to extract an array for the "tags" field. If I use exactly as above I get the error that "there is no HTTPMessageConverter for Object[]", if I try to add runtime type info to toArray() I get "generic array" exception (because of Object value of the map), if I try to use taggingData structure as it is I get the error that "there is no HTTPMessageConverter for ArrayList", etc. I've tried several combinations, no one worked so far.

    Also, I posted an untagged photo, then I tagged it manually and then used

    Code:
    facebook.restOperations().getForEntity(uri, Map.class)
    to fetch it from Facebook and compare to what I'm doing. Not many hints in there either.

    Has anybody tried this before? Any help will be greatly appreciated. Thanks a lot.
Working...
X