2013-11-14 32 views
-1

是的,這裏有近百個相同的問題。我已經嘗試過在論壇上提供和搜索的答案等等,但都不適用於我:(我在Facebook上有一個應用程序,我想發佈一個鏈接到我的網頁的時間軸(不在用戶的時間線上) 。我怎樣才能做到這一點使用PHP SDK?我發現這個職位How do you post to the wall on a facebook page (not profile)。它是非常豐富的,但我仍然不知道該怎麼做。我也是這個職位Post to Facebook Page Wall。仍然沒有幫助,這是我現在擁有的:如何作爲應用程序或頁面(不是用戶)在頁面的牆上張貼

 require_once('libs/facebook.php'); 
    $facebook = new Facebook(array(
     'appId' => 'xxxxxxxxxxxxxxxxxx', 
     'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx' 
    )); 

    $attachment = array(
     'link' => $post_link, 
     'message' => 'Another Super Story!', 
     'actions' => array(
      array(
       'link' => $post_link 
      ) 
     ) 
    ); 

    $result = $facebook->api('/me/feed/', 'post', $attachment); 

我看到這個代碼,但我不知道是什麼的數字代表

$facebook->api('/123456789/feed', 'post', array( 'access_token' => $token, 'link' => 'http://www.example.com' ));

認罪e幫助我。即時通訊拼命解決我的問題。我不知道該怎麼辦。先謝謝你。

編輯: 我現在有這個代碼,因爲我已經提到這個問題Facebook API: How to post to my own wall page?。但仍然不適合我。任何人都可以說出我錯過的東西?

$page_access_token = "2xxxxxxxxxxxx|bxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; 
       $result = $facebook->api("/me/accounts"); 
       foreach($result["data"] as $page) { 
        if($page["id"] == $page_id) { 
         //$page_access_token = $page["access_token"]; 
         $page_access_token = $facebook->api("/".FB_PAGE_ID."?fields=access_token"); 
         break; 
        } 
       } 
    $attachment = array(
    'message' => $post_msg, 
    'link' => $post_link, 
    'access_token' => $page_access_token, 
    ); 
    $facebook->api("/".FB_PAGE_ID.'/feed', 'POST', $attachment); 

回答

相關問題