Load comments from open graph object into Facebook comments social plugin - facebook

I have created a website connected my facebook app. Users can login and post a custom action connected to a custom object with open graph, javascript sdk. This will also post with 'fb:explicitly_shared' set to true so it will generate a post on the users timeline. So these custom objects have their own url and on those pages i want to have the comment plugin. And i want that object page (with the comments plugin) and the post on the users timeline to share comments.
I have tried setting a lot of different things in the "href"-property on the comments plugin but nothing seems to work. However i have managed to get the comments of the timeline post with a call to '/objectid/comments' with FB.api(). I can use that to build my own comments ui, but i rather use the comments social plugin. Is there any way to make it happen?

The Post ID and the Open Graph Object ID are different, so I do not believe that they can share comments. Comments are based off a single Facebook ID. Also, it is not currently possible to write comments to an Open Graph Object from the API (comments plugin only) so you can't really create your own comments plugin for an OG object.

Related

Is it possible to use Facebooks Comments Plugin with Graph Object IDs/Graph URLs rather than www URLs?

A little while ago, I built this:
http://www.littlebray.co.uk/photos.aspx
It's kind of an off-Facebook partial replica of a Facebook photo album gallery, the photos in the gallery section are all pulled from Facebook albums on the Page for Little Bray (fb.com/littlebray) enlarging them gives you a kinda full screen view of them with commenting facilties on the right margin, just like Facebook.
You'll notice that, whilst this comment section looks a bit like a Facebook plugin, it isn't, and the reason for this is that if I used Facebooks Comments Plugin, when a user comments on a photo on the website, or comments on the same photo (remembering the photos come from the same source), it will create two different streams of comments, one shown on FB and one shown on the website.
With my method, any comments posted either on the website or FB will appear in both places as they're al directly injected into the FB graph relating to the object ID of the photo.
A bit later on, I created another, similar image gallery but used Facebooks Social Plugin "Comments" in the right hand margin to comment on photos. The difference here though was that these photos were lcoally hosted by the website and not already Facebook album objects, so this other website is the only source for these images and thus creating FB objects when commenting via a URL is fine.
BUT... it got me thinking, is my first example just a lot of work, is it possible to use Facebooks own Social Plugin to post comments on an object which already exists on Facebook in that way?
I tried pasting a graph URL https://graph.facebook.com/FB_OBJECT_ID into the Comments example on Facebooks Social Plugins page from a status update of mine, but nothing showed.
Any ideas?
EDIT ---
I have discovered I am not alone in asking this question:
Using social plugins for pre-existing Facebook posts
Load comments from open graph object into Facebook comments social plugin
Neither of those have satisfactory answers though. Perhaps I just need to improve my own code and make my own plugin.
At this time the comments plugin can not be used in that way.

Custom Facebook comment box

I want to build custom Facebook comments box for that I have done lots of R&D but I am stuck on how will I post comments against the url of different pages of my website.
I want the similar functionality which Facebook's comment box plugin provides like I will drop my custom Facebook comments box on my page template and it will work for all the pages which are inheriting from that template. Which means each dynamic page will have its own commenting box depending on its url.
It would be better if anyone provide me steps to achieve this functionality. I have gone through the Facebook developers forum and have learn commenting against the ID of Objects but I want to start comment box from page Url as Facebook's comments box takes href of the page.
My test work:
When I have posted comments through Facebook comment box plugin against url and get all of them using Graph api so all comments are listing successfully.
but when I try to post the comments against the mentioned url using graph api so I get the exception here.
https://lh3.googleusercontent.com/-KckTuX8DifY/UOFP_e-5ayI/AAAAAAAAAJc/e1wYHZGN9Nc/s629/Get+and+Post+Comments.png
I need answers of following questions.
How will I start commenting against page's url.
My custom commenting box template are shown below
https://lh4.googleusercontent.com/-7iP0_Xi22zk/UOFOn_g_Q7I/AAAAAAAAAJI/FlnDhDTSyZs/s622/Custom+FB+comments+box.jpg
Thanks

Comments social plugin for Action post

I have an app app1 which defines a custom Facebook action act1.
When a user performs this action to an entity (ntt1) in my app, I post to API /me/app1:act1 with URL to ntt1 as its param, so that a post is generated on user's wall saying User act1'ed ntt1 where ntt1 is a link to ntt1's view page (with open graph meta data on its header).
Users can comment or like on this wall post regularly.
Now I want to show users' comments on ntt1's web page as well to share the comments and likes between the Facebook wall and ntt1's view page.
I tried using the Comments social plug-in, but don't know what to put in the data-href to point to the action_instance_id of the wall post.
I know I can simulate a comments box on my page using the graph API (and I've already done so), but this is not making a good ux, because the users need to authorize to my application to view this page (so that the java script API can fetch the comments from the Facebook).
Have you tried just pointing the data-href attribute to
https://www.facebook.com/{user_name_or_id}/activity/{action-instance-id}
…? The docs for using actions say this is the URL you can use to “preview” the news feed story that this published action will generate (or rather has already generated, because without publishing the action first, you would not have an action-instance-id).
If you click on the “x minutes/hours/… ago” link for the feed story for one of your published actions, it should take you to a link that’s build using the same scheme.

Facebook Share Icon not visible for posts made through Graph API

I have a problem with posting updates to facebook through graph API,when i post something to facebook through graph API, only like and comment are shown for that update in facebook and no share icon, after a little googling i found out that we should use me/links as end point while posting and that's working great i can see share icon for all the link updates i am making now but the problem is how should i handle the case for normal text updates without any links in them how should i post such updates in order to get share icon in facebook,
below is the code i am using for link updates,it posts the update and i can see the share icon in facebook
facebookClient.publish("me/links", String.class , inputStream,
Parameter.with(ACCESS_TOKEN_PARAM, accessToken), Parameter.with(MESSAGE, message),
Parameter.with(PICTURE, imageURL), Parameter.with(LINK, link==null?"":link));
and below is the code i am using to post text updates this code posts the update but with no share icon in facebook.
facebookClient.publish("me/feed", String.class ,
Parameter.with(ACCESS_TOKEN_PARAM, accessToken), Parameter.with(MESSAGE, message));
This is currently not a feature of the Graph API unfortunately. There is a feature request report here that I would recommend you support by voting for it.
As a workaround, you should consider using an Open Graph Action with a user message as opposed to a stream publish call as it will show the Share link and other custom action links can be included too.

Facebook - syncing comments social plugin with comments on object's?

Currently i am adding the social plugins to my site. Specifically to my photo albums. To generate the albums i am using fql to grab all the albums from a certain page. So it then occurred to me that people will be commenting inside of facebook but the social plugin will only show comments for the url not for the photo's object inside facebook. I know i can get the object_id from the fql. Is there a way to link the two together so if a user comments on either my site or facebook it will be all included.
So i am a little stumped i looked around the graph api for quite some time with no luck so anybody have any ideas? :\
cheers guys
So there isn't currently a plugin that lets you put an Object_id into and it will grab all of the comments out for that object.
You will need to use the graph api and if the album is public then you will not need a oauth code to access the comments. Once you have this object just convert it to a a stand-object array and do what you will with it ;)