0

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

但它只能运行 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>

4

1 回答 1

0

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

于 2013-02-26T16:21:27.603 回答