I have a site that shows pictures grouped by activity plus some extra data. It's a mashup of Facebook data and some other data.
I would like to let users comments on the activities and photos, and then have those comments appear on Facebook as well under the activities and comments. Yet it appears that the social plugin for comments doesn't support Facebook objects - only URLs.
EDIT:To be more clear, Facebook deprecated the FBML, and tells us to use HTML and JavaScript. But there is no obvious UI for Comments for JavaScript (https://developers.facebook.com/docs/reference/fbml/comments_(XFBML)/)
Am I missing something? Do I have to write my own UI for photo and activity comments?
Bill you will need to use the graph api and one of the sdk's, i use php sdk for the exact same function.
refer to post object https://developers.facebook.com/docs/reference/api/post/#comments
Create
You can write to the POST_ID/comments connection to post a comment to the post by issuing an HTTP POST request with the publish_stream permission and following parameters.
refer to php-sdk https://developers.facebook.com/docs/reference/php/
i use REQUEST method to catch post by page and the api to push to the graph. my sample below. NOTE: this assumes you have Facebook php sdk 3.1.1 installed on your server.
$postid = $_REQUEST['postid']; // id of the post
$message = $_REQUEST['msg']; // users message for comment
$params = array(
'access_token' => ''.$access_token.'', // user access token and read_stream perms needed
'method' => 'post',
'message' => ''.$message.'',
);
try {
$sendComment = $facebook->api('/'.$postid.'/comments', 'post', $params);
} catch (FacebookApiException $e) {
echo 'AF error: '.$e.'';
}
}else{
}