[英]Share post to multi friends wall using Facebook SDK and Javascript
[英]how to update data in mysql when user share post on facebook using Facebook SDK for JavaScript
當用戶在fb上分享帖子時,我想更新數據庫。 我正在使用JAVASCRIPT的Facebook SDK。
我的代碼是:-
<script>
document.getElementById('shareBtn').onclick = function() {
FB.ui({
method: 'share',
display: 'popup',
href: 'url goes here',
}, function(response){
if (response && response.post_id) {
//ajax code goes here for database update
} else {
alert('oops post was not published');
}
});
}
</script>
按鈕代碼
<div class="fb-share-button"
data-href="url goes here"
data-layout="button" data-size="large">
</div>
我可以分享帖子,但是當用戶成功分享帖子時如何更新mysql數據
僅當您使用publish_actions
權限授權該用戶時,您才知道該用戶是否共享了某些內容。 恐怕該權限需要得到Facebook的審查,恐怕Facebook不會僅為此批准。
換句話說:這是不可能的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.