简体   繁体   中英

Facebook send message to multiple users

I want to send message to multiple users. I don't know what I did wrong.

But it can run only JavaScript Test Console.

this is my code:

<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>

Method send doesn't allow multiple user ids in the to field. Code allows only one id . Users can enter additional recipients in the dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM