2011-07-23 12 views
1

爲什麼Facebook stream.share在用戶發佈狀態或單擊「跳過」時返回undefined?Facebook stream.share返回undefined

我目前正在嘗試使用它,所以如果用戶不發佈內容,則不應該發生任何操作,但是如果用戶發佈內容,則應該發生操作。

我該怎麼做?

回答

1

您可以使用圖形API飼料對話框發佈後,知道它是否是由用戶發佈或不:

FB.ui(
    { 
     method: 'feed', 
     message: '', 
     name: 'name here', 
     caption: 'caption here', 
     description: 'description here', 
     picture: 'picture url here', 
     link: 'http://yourlinkurlhere.com', 
     actions : [{name : 'action name', link : 'action link'}] 
    }, 
    function(response) { 
     if (response && response.post_id) { 
      // Post was published 
     } else { 
      // Post did get published 
     } 

});