diff --git a/CHANGELOG.md b/CHANGELOG.md index 19538e6..c88fa5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +* Updated Facebook Graph API to version 3. (richard67) + ## 7.1.2 2018-05-25 * Updated `guzzle` and `phpunit` dependencies. (liayn) diff --git a/src/Backend/Facebook.php b/src/Backend/Facebook.php index f17e338..c41b886 100644 --- a/src/Backend/Facebook.php +++ b/src/Backend/Facebook.php @@ -32,7 +32,7 @@ public function setConfig(array $config) public function getRequest($url) { $accessToken = urlencode($this->config['app_id']) .'|'.urlencode($this->config['secret']); - $query = 'https://graph.facebook.com/v2.12/?id='.urlencode($url) . '&fields=engagement&access_token=' + $query = 'https://graph.facebook.com/v3.0/?id='.urlencode($url) . '&fields=engagement&access_token=' . $accessToken; return new \GuzzleHttp\Psr7\Request('GET', $query); diff --git a/tests/FacebookTest.php b/tests/FacebookTest.php index fed9a3e..2b243dd 100644 --- a/tests/FacebookTest.php +++ b/tests/FacebookTest.php @@ -31,7 +31,7 @@ public function testUsesGraphApi() $request = $facebook->getRequest('http://www.heise.de'); $this->assertEquals('graph.facebook.com', $request->getUri()->getHost()); - $this->assertEquals('/v2.12/', $request->getUri()->getPath()); + $this->assertEquals('/v3.0/', $request->getUri()->getPath()); $this->assertEquals( 'id='.urlencode('http://www.heise.de').'&fields=engagement&access_token=foo%7Cbar', $request->getUri()->getQuery()