Here's a sample code of how one could implement this method:
public function removeComment($commentId, $xid)
{
try {
// This prevents FB from throwing: `SSL certificate problem, verify that the CA cert is OK.`
// Not required if you have your SSL certificate
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;
$client = $this->getClient(); // Create an instance of our PHP SDK
return $client->api(array(
'method' => 'comments.remove',
'comment_id' => $commentId,
'xid' => $xid,
));
} catch (FacebookApiException $e) {
Yii::log($e->__toString(), CLogger::LEVEL_ERROR, __CLASS__);
}
return false;
}
{
try {
// This prevents FB from throwing: `SSL certificate problem, verify that the CA cert is OK.`
// Not required if you have your SSL certificate
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;
$client = $this->getClient(); // Create an instance of our PHP SDK
return $client->api(array(
'method' => 'comments.remove',
'comment_id' => $commentId,
'xid' => $xid,
));
} catch (FacebookApiException $e) {
Yii::log($e->__toString(), CLogger::LEVEL_ERROR, __CLASS__);
}
return false;
}
0 comments :
Post a Comment
Hi there! Please leave your message here. Also, I may not be able to respond to your query right away. So please bear with me. Thanks. :)