Using api v2.9.
include('controller/facebook/init.php');
try {
// Returns a 'Facebook\FacebookResponse' object
$response = $fb->get(
'/POST_ID/likes',
'ACCESS_TOKEN',
'summary=total_count'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphEdge = $response->getGraphEdge();
print_r($graphEdge);
The goal in question is to get the total likes of the post, I also believe that changing the term 'likes' by shares
or comments
will return the data corresponding to the post.
The returned print is that of the image, but the total is not returned.