如何检测Facebook共享成功?使用Javascript

How to detect Facebook share success? with Javascript

本文关键字:成功 共享 使用 Javascript Facebook 何检测 检测      更新时间:2023-09-26

此代码正在共享facebook,但我想要如何检测facebook共享成功如何使用javascript 做到这一点

u = location.href;
t = document.title;
var myWindow = window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
return false; 

看来你应该使用FB.ui

FB.ui(
   {
     method: 'feed',
     name: 'Facebook Dialogs',
     link: 'http://developers.facebook.com/docs/reference/dialogs/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
     message: 'Facebook Dialogs are easy!'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 );