2013-03-05 51 views
1

我已經創建了一個Facebook應用程序,需要在所有用戶FB WAll上發佈,這些用戶已授權應用程序代表發佈該代碼。如何通過API代碼發佈在FB應用程序用戶牆上

即,某個新事件組織在某處,所以通過App,管理員可以在每個應用用戶FB Wall上發佈關於該事件的信息。

我正在使用Graph API,但它不工作。

任何指針/指導將受到高度讚賞。

謝謝

+0

什麼平臺是U時工作,js或php? – ThePCWizard 2013-03-05 11:54:12

+0

在我的網站上使用php – 2013-03-07 14:11:27

+0

檢查更新的答案 – ThePCWizard 2013-03-08 06:01:35

回答

0

你必須做一個帶參數的api調用在用戶牆上發佈。

編輯:

這裏是鏈接如下例子,有一些解釋:

<?php 
$attachment = array(
'message' => 'this is my message', 
'name' => 'This is my demo Facebook application!', 
'caption' => "Caption of the Post", 
'link' => 'http://mylink.com', 
'description' => 'this is a description', 
'picture' => 'http://mysite.com/pic.gif' 
); 
?> 
$result = $facebook->api('/me/feed/', 'post', $attachment); 

$attachment數組包含的牆後的參數和$facebook->api('/me/feed/','post',$attachment);撥打電話,並將結果返回到$result

在這裏你可以找到源:How do you post to the wall on a facebook page (not profile)

+0

請提供示例代碼,說明它是如何工作的,而不是鏈接到示例。你可以發表評論,而不是回答。 – 2013-03-05 11:14:09

0

發佈到用戶在JS SDK牆:

var body = 'Status Test'; 
FB.api('/me/feed', 'post', { message: body }, function(response) { 
    if (!response || response.error) { 
     alert('Error occured'); 
    } else { 
     alert('Post ID: ' + response.id); 
    } 
}); 

[編輯]
在PHP

$ret_obj = $facebook->api('/me/feed', 'POST', 
       array(      
        'message' => 'Posting with the PHP SDK!' 
      )); 
相關問題