facebook multi-friend selector( javascript SDK), counting number of friends
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 followi开发者_C百科ng code.
function InviteFriends(){
FB.ui({ method: 'apprequests',
message: 'come on man checkout my application.'});
}
thanks
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');
}
});
精彩评论