facebook multi-friend selector( javascript SDK), counting number of friends

丶灬走出姿态 提交于 2019-12-14 00:28:26

问题


Hi i just wanted to know, is there any way to know how many friends the user selects from the multi-friend selector generated by the following code.

function InviteFriends(){
     FB.ui({ method: 'apprequests',
          message: 'come on man checkout my application.'});
    }

thanks


回答1:


Yes, Facebook will send back the request_ids for all the requests sent. so the number of requests would equal the number of friends selected.

How to access the request_ids is described in this tutorial: How To: Send An Application Request Using The Facebook Graph API

FB.ui({
    method: 'apprequests',
    message: 'Check out this application!',
    title: 'Send your friends an application request',
},
function (response) {
    if (response && response.request_ids) {
        // response.request_ids is what you need
    } else {
        alert('canceled');
    }
});


来源:https://stackoverflow.com/questions/5729987/facebook-multi-friend-selector-javascript-sdk-counting-number-of-friends

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!