Skip to content

Commit

Permalink
fixed Something went wrong while fetching the access token
Browse files Browse the repository at this point in the history
There is a change from facbook, when they sent the token back it does not contain '=' as expected in exisitng code, due to that it triggers `Something went wrong while fetching the access token` error!
  • Loading branch information
LeorentKelmendi authored Feb 1, 2018
1 parent 5fe49ea commit 5ecf1aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LaravelFacebookAds/Services/FacebookAdsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ public function generateAppToken(AccountInterface $account)
)
);

if (!substr_count($token, 'access_token=')) {
if (!substr_count($token, 'access_token')) {
return false;
}

$token = str_replace('access_token=', '', $token);
$token = str_replace('"access_token":', '', $token);

return $token;
}
Expand Down

0 comments on commit 5ecf1aa

Please sign in to comment.