2012-02-27 21 views
0

我有offline_accessmanage_pages權限,但我不斷收到各種OAuth錯誤的 - 與下面的代碼,我得到更新Facebook的企業頁面,當用戶離線

Fatal error: Uncaught OAuthException: Error validating access token: The session has been invalidated because the user has changed the password.

我救了兩個用戶訪問令牌和頁面訪問數據庫中的令牌,然後嘗試使用它更新用戶在離線時用戶是管理員的頁面。我似乎無法完成這項工作:

$access_token = User token got when user was logged in; 
$news_token = Page token got when user was logged in; 

// $accounts_url = "https://graph.facebook.com/me/accounts?" . $access_token; 

      $page_info = $facebook->api("/$news_page?fields=access_token"); 
        $args = array(
            'access_token' => $news_token, 
            'message'  => $u, 
            'link'   => $news_url, 
            'description' => $u, 
            'name'   => $news_title, 
            'picture'  => $image 
           ); 

        $post_id = $facebook->api("/$page_id/feed","post",$args); 
        echo $news_source."(Offline): ".$u."<br />\n"; 

上面的註釋掉的行顯示了另一件我試圖無效的東西。

任何人都可以幫忙嗎?

回答