Here is my code:
login.php:
\'\',
\'
You didn't retrieve the valid access token.
Change:
$fb = new Facebook\Facebook([
'app_id' => '',
'app_secret' => '',
'default_graph_version' => 'v2.2',
]);
$helper = $fb->getRedirectLoginHelper();
try {
$accessToken = $helper->getAccessToken();
$response = $fb->get('/me?fields=id,name', $accessToken );
....
} catch(Facebook\Exceptions\FacebookResponseException $e) {
...
Have a look here
Error:
Facebook SDK returned an error: Access token was not returned from Graph.
Only add Your call back URL in
$helper = $fb->getRedirectLoginHelper();
to
$helper = $fb->getRedirectLoginHelper('http://www.sportsector.bg/login-callback.php');
it's Working form me ..