facebook多人选择器(javascript SDK),计数好友数量 [英] facebook multi-friend selector( javascript SDK), counting number of friends

查看:130
本文介绍了facebook多人选择器(javascript SDK),计数好友数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我只想知道,有没有办法知道用户从以下代码生成的多方选择器中选择了多少个朋友。

 函数InviteFriends(){
FB.ui({method:'apprequests',
message:'来看看我的应用程序。
}

谢谢

解决方案

是的,Facebook将发送所有发送的请求的 request_ids 。所以请求的数量等于所选朋友的数量。



本教程介绍了如何访问 request_ids 如何:使用Facebook Graph API发送应用程序请求

  FB.ui({
method:'apprequests',
message:'Check这个应用程序!',
标题:'发送你的朋友的应用程序请求',
},
函数(响应){
if(response&& response.request_ids ){
// response.request_ids是你需要的
} else {
alert('cancelled)';
}
});


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

解决方案

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

这篇关于facebook多人选择器(javascript SDK),计数好友数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆