best way to get new access_token using PHP sdk
- by randy
I am getting the error
"An active access token must be used to query information about the current user".
There seems to be tons of articles and ideas, but am very confused and it seems that things are changing as well. A lot say to use offline-access but that appears to be going away.
I did find this article.
Does anyone have an example using the PHP SDK?
I tried doing something like the below but it does not seem to work; $FBuser is still zero:
$token_url = "https://graph.facebook.com/oauth/access_token?" .
"client_id=" . FB_APP_ID .
"&client_secret=" . FB_APP_SECRET .
"&grant_type=client_credentials";
list($name, $ACCESS_TOKEN) = explode("=", file_get_contents($token_url) );
$facebook->setAccessToken(ACCESS_TOKEN);
$FBuser = $facebook->getUser();