2013-02-19 145 views
0

我想发送消息给多个用户。我不知道我做错了什么。Facebook发送消息给多个用户

但它只能运行JavaScript测试控制台。

这是我的代码:

<html> 
<body > 
    <div id="fb-root"></div> 
    <script src="http://connect.facebook.net/en_US/all.js"></script> 
    <script> 
     window.fbAsyncInit = function() { 
      FB.init({ 
       appId  : 'MY APP ID', 
       status  : true, // check the login status upon init? 
       cookie  : true, // set sessions cookies to allow your server to access the session? 
       xfbml  : true, // parse XFBML tags on this page? 
       oauth: true // enable OAuth 2.0 

      }); 
     }; 

     (function(d, debug){ 
      var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; 
      if (d.getElementById(id)) {return;} 
      js = d.createElement('script'); js.id = id; js.async = true; 
      js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js"; 
      ref.parentNode.insertBefore(js, ref); 
     }(document, /*debug*/ false)); 

     function sendmsg(){ 
      FB.ui({ 
       method: 'send', 
       to: ['100000793830311','100002551899151'], 
       name: 'test msg', 
       link: 'http://www.google.com' 
      }); 
     }  
    </script> 

    <button onclick="sendmsg();">SEND</button> 
</body> 

回答

0

方法send不允许在to领域的多个用户ID。 代码只允许一个id。用户可以在对话框中输入其他收件人。

+0

感谢朋友。但是JavaScript测试控制台将允许多个用户。 – 2013-03-02 21:20:24