Skip to content

Commit

Permalink
Merge branch 'richard67-facebook-graph-api-v3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
compeak committed May 30, 2018
2 parents 00c497b + b27f5d9 commit 8a37804
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/Facebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/FacebookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8a37804

Please sign in to comment.