heiseonline / shariff-backend-php

đź‘® PHP backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.
http://ct.de/-2467514
133 stars 44 forks source link

[BUG] Facebook API V.2.2 was disabled 2017-03-27 #121

Closed JohannesTyra closed 7 years ago

JohannesTyra commented 7 years ago

The Code / Facebook Request does not work anymore.

if (null !== $accessToken) { $query = 'https://graph.facebook.com/v2.2/?id='.urlencode($url).'&'.$accessToken; } else { $query = 'https://graph.facebook.com/?id='.urlencode($url); }

liayn commented 7 years ago

Where do you have this information from?

We see errors as well, but those seem to be IP based, since manual requests using the same request still work.

JohannesTyra commented 7 years ago

I get this message from FB (German).

XXXX hat derzeit Zugriff auf Graph API v2.2. Diese Version läuft am 27 March, 2017. zum Ende des 2 Jahre gültigen Zeitraums ab. Um einen reibungslosen Übergang sicherzustellen, solltest du alle API-Aufrufe zu Graph API v2.3 oder höher migrieren.

Wenn du herausfinden möchtest, ob deine App von diesem Upgrade betroffen ist, kannst duVersion Upgrade Tool.verwenden. So erfährst du, welche Aufrufe unter Umständen von dieser Änderung betroffen sind und welche in neuen Versionen ersetzt werden. Wenn dir keine Aufrufe angezeigt werden, dann ist deine App von dieser Änderung wahrscheinlich nicht betroffen.

JohannesTyra commented 7 years ago

The first call with /v2.2 does not work since 27 March, 2017. The second (old) FQL Call does not work since Nov 2016 I think.

So maybe: $query = 'https://graph.facebook.com/?id='.urlencode($url).'&'.$accessToken; works?

JohannesTyra commented 7 years ago

FB Doc:

curl -i -X GET \ "https://graph.facebook.com/v2.8/?id=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt2015381%2F&access_token=TOKEN"

liayn commented 7 years ago

Yes, updating would indeed make a lot of sense. Can you push a PR? Besides that maybe consider also #120

JohannesTyra commented 7 years ago

Its fixed. Only this is needed.

    $accessToken = urlencode($this->config['app_id']) .'|'.urlencode($this->config['secret']);
    $query = 'https://graph.facebook.com/v2.8/?id='.urlencode($url).'&access_token='.$accessToken;

    return new \GuzzleHttp\Psr7\Request('GET', $query);
liayn commented 7 years ago

confirmed! lets kick the part when no accesstoken is there so #120 is resolved too.

JohannesTyra commented 7 years ago

Yes. And one request less than before (the extra oauth request is not needed)

liayn commented 7 years ago

preparing PR now

compeak commented 7 years ago

Fixed in v7.0.0.

djpytter commented 7 years ago

Hello. I have this verion API on my webpage fbapi.php https://github.com/facebookarchive/facebook-php-sdk/blob/master/src/base_facebook.php

Please let me know what to change so I can go on my webpage login with facebook again. Please:!