0
我有這樣的情況,如何讀取我的FB帳戶的所有Facebook相冊沒有登錄
閱讀我的所有FB專輯和其全部內容,以顯示它在網絡上page.But的問題是我不」我想爲此登錄。
像我的Fb專輯一樣顯示在我的網頁上。
我發現相同的問題here但解決方案沒有得到。
我做的是創建一個應用程序。
require 'facebook/facebook.php';
$facebook = new Facebook(array(
'appId' => FB_APP_ID,
'secret' => FB_APP_SECRET,
));
$access_token = "ccc"; this is from graph explorer 1 hr valid key when i logged in then only get this
echo $url = "https://graph.facebook.com/oauth/access_token?
client_id=".FB_APP_ID."&
client_secret=".FB_APP_SECRET."&
grant_type=fb_exchange_token&
fb_exchange_token=".$access_token;
//echo "sss".$return = file_get_contents($url);
try {
$result = $facebook->api('/MyFBACCId/albums',array('access_token' => $access_token));
echo "<pre/>";
print_r($result);
} catch(FacebookApiException $e) {
$result = $e->getResult();
//error_log(json_encode($result));
echo "Error Condition";
echo "<pre/>";
print_r(($result));
}
我也試圖程度的關鍵到期,但它不工作像 返回The access token does not belong to application APP_ID
所以我的問題是這有可能拿到專輯細節,而不會登錄。
我發現了一些例子,如here,在我的帳戶中,我也給公共範圍的專輯。但是當我嘗試使用圖形瀏覽器時,它會返回空結果。
了整整一天我堅持任何幫助,這將欣賞:(
+ 1感謝您的回覆。那麼延長1小時令牌到60天並每天更新一次呢? –
是的,你可以做到這一點,如果你不希望用戶儘快重新連接,但仍然想更新他的信息。 –