1

我想向多个用户发送 facebook 消息,并且在发送消息后,我希望对话框中的这些用户 ID 作为响应。

我搜索到仅使用方法发送是不可能的,所以首先我使用apprequests方法,从这个响应中我想将选定的用户传递给 facebook 发送对话框。

这是我正在使用的代码。

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',
    });
}

但是在这种情况下,当邀请朋友后出现消息对话框时,它只选择一个用户而不是多个用户。

请帮帮我。

谢谢!

4

0 回答 0