1

I want to send facebook message to multiple users and after sending message I want those user ids from dialog in response.

I searched that it is not possible only with method send so first I am using apprequests method and from this response I want to pass selected users to facebook send dialog.

Here is the code which I am using.

FB.ui({
        method: 'apprequests',
        message: "my app request message",
        link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html',   
    }, function(response) {
        if(response && response.hasOwnProperty('to')) {
            var user_ids    =   [];
            for(i = 0; i < response.to.length; i++) {
                user_ids.push(response.to[i]);
            }
            console.log(user_ids);
            fb_share(user_ids);
        }
    });


function fb_share(user_ids){
    FB.ui({
      method: 'send',
      to: user_ids, //[862579587127634, 1571716563066056],
      link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html',
    });
}

But in this case when Message dialog box appears after inviting friends, it selects only one user not multiple users.

Please help me guys.

Thanks!

Akash Mishra
  • 179
  • 3
  • 15

0 Answers0