2012-02-04 24 views
0

我正在使用以下內容,通過頁面上Facebook的「贊」按鈕來顯示已經喜歡我公司頁面的用戶的優惠券。用戶發表評論後,Facebook JavaScript SDK中是否存在一個事件?

FB.Event.subscribe('edge.create', 
function(response) { 
// action 
} 
); 
}; 

當用戶點擊「喜歡」按鈕,如果他們想將其與消息發佈到他們的牆上和回調發生在這個時候顯示優惠券的框,詢問。

在用戶發佈(或選擇不發佈)之後是否存在回調?

回答

0

我用這樣的職位,然後檢查響應:

<script> 
function fb_share() { 
    FB.ui({ 
     method: 'feed', 
     name: 'Name of App', 
     link: 'http://YOURLINK.com', 
     picture: 'someurltoimage.jpg', 
     description: 'Your description of the post for the wall!' 
     }, 
     function(response) { 
     if (response && response.post_id) { 
      console.debug(response.post_id); 
     // Post was published - now lets send it to our ouwn custom processing page on our server 
     $.post('/process-post',{uid: <?php echo $currentUser; ?>, wallpost: response.post_id},function(resp) { 
       // callback after storing the requests 
      }); 
     } else { 
     // Post was not published; 
     } 
    }); 
return false; 
} 

</script> 
+0

感謝您的幫助Briam。我會研究一下類似的格式是否可行。我的直覺是,這隻會確定他們發佈的內容,而不是他們發佈或繞過發佈步驟。 哦,好的。我想我已經儘可能地接近了。再次感謝! – 2012-02-06 00:06:00

相關問題