資料來源1: How To: Get A Facebook Application Access Token
http://www.masteringapi.com/tutorials/how-to-get-a-facebook-application-access-token/41/
資料來源2: facebook SDKs & Tools - PHP SDK - api
http://developers.facebook.com/docs/reference/php/facebook-api/
方法1:
------------------
$APPLICATION_ID = "APP_ID";
$APPLICATION_SECRET = "APP_SECRET";
$token_url = "https://graph.facebook.com/oauth/access_token?" .
"client_id=" . $APPLICATION_ID .
"&client_secret=" . $APPLICATION_SECRET .
"&grant_type=client_credentials";
$app_token = file_get_contents($token_url);
方法2:
------------------
$facebook->getAccessToken();
這2個方法, 都可以取得 app access token, 建議使用方法2.
沒有留言:
張貼留言