Spring Social Facebook - Publish / Publish API Information

I studied the Spring Social Facebook publish (objectId, connectionName, data) API , but I'm not sure about using this API (unfortunately due to lack of javadocs!). Can someone point me to the full use of the sample API, please?

What I want to do is post a story on the user's wall, similar to the screenshot below:

enter image description here

How to use publish () API to do the same? Any help is much appreciated!

In addition, I need my post to have additional actions (except Like, Comment).

+4
source share
3 answers

Here is what I could finally find out:

MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>(); map.set("link", linkUrlString); map.set("name", "Link Heading"); map.set("caption", "Link Caption"); map.set("description", "Loooooo....ng description here"); map.set("message", "hello world"); // THE BELOW LINES ARE THE CRITICAL PART I WAS LOOKING AT! map.set("picture", "http://www.imageRepo.com/resources/test.png"); // the image on the left map.set("actions", "{'name':'myAction', 'link':'http://www.bla.com/action'}"); // custom actions as JSON string publish(userIdToPostTo, "feed", map); 
+1
source

The link you provided already contains a lot of documentation for the method.

Find one example with the publish(objectId, connectionName, data) stream publish(objectId, connectionName, data) here

Also see many examples for github-SpringSource for additional actions, including publish(objectId, connectionName, data) .

Update:

You can get some help from this method:

 public void postToWall(String message, FacebookLink link) { MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>(); map.set("link", link.getLink()); map.set("name", link.getName()); map.set("caption", link.getCaption()); map.set("description", link.getDescription()); map.set("message", message); publish(CURRENT_USER, FEED, map); } 
+6
source

As above, but I use the post for my solution. See this:

<i>

 MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>(); map1.set("link", "https://www.facebook.com/profile.php?id=100006216492034"); map1.set("name", "Project Test Post to Group"); map1.set("caption", "Please ignore this Post"); map1.set("description", "YOLO here is my discription, Please ignore this post"); facebook.post("userId or GroupID", "feed", map); 

0
source

Source: https://habr.com/ru/post/1386067/


All Articles