Closed ahoiroman closed 6 years ago
Problem can be solved by changing:
heise/shariff/src/Backend/Facebook.php
Replace in function getRequest
$query = 'https://graph.facebook.com/v2.8/?id='.urlencode($url).'&access_token='.$accessToken;
with
$query = 'https://graph.facebook.com/v2.10/?id='.urlencode($url).'&fields=og_object{engagement}&access_token='.$accessToken;
And in function extractCount
Add
if (isset($data['og_object']['engagement']['count'])) {
return $data['og_object']['engagement']['count'];
}
return 0;
}
This seems to be an issue with the settings of your facebook user. AFAIK you can set the minimum API version per user. I suppose your's is 2.10 The current code works flawlessly for us on various live sites
If you create a new Facebook App, you can not set an API-version < 2.10 .
So the current code does only work if you created your app a while ago.
Alright. Thanks for figuring that out. Time to update the code then. Can you please push your suggested change as a pull request to speed up things?
Pull request see https://github.com/heiseonline/shariff-backend-php/pull/128. Please test.
Works for me :)
Any idea, when this will be merged? My users (I created a little extension for Pagekit CMS) are waiting for this :)
@SPQRInc Maybe ask here: https://github.com/heiseonline/shariff-backend-php/pull/128.
Great, it has been merged :)
Now I'm just waiting for a release of version 7.1, which includes the bugfix :)
@SPQRInc No need to wait, 7.0.1 is out.
Hi there,
am using the backend for quite a while now.
But unfortunately the facebook-count always shows
0
.This is my config:
This is the result:
{"facebook":0,"googleplus":0}
But it should be 30?