我正在尝试使用以下代码使用“apprequest”对话框发送应用请求
但在此出现请求对话框但未发送请求
var 邀请朋友;
window.fbAsyncInit = function() {
FB.init({
appId : '112312312312321',
状态:真,
channelUrl : '//mysite.com/include/fb/channel.php',
饼干:真的,
无摩擦请求:真
});
// 这里额外的初始化代码
FB.getLoginStatus(函数(响应){
if (response.status === '已连接') {
// 用户已登录并连接到您的
// app 和 response.authResponse 提供
// 用户的 ID、有效的访问令牌、签名的
// 请求,以及访问令牌的时间
// 并且签名的请求每个都过期
console.log('授权');
FB.api('/me', function(response) {
console.log(response.name);
});
inviteFriends=function(){
var l="";
FB.api('/me/friends',function(response){
console.warn(response.data.length);
for (var i=0; i<20;i++){
//alert(o.id);
l=l+','+response.data[i].id;
}
console.log(l);
FB.ui({method: 'apprequests',
message: 'Hey send me a pic usign picinchat.com in fb chat!',
to: l
}, function(response){
console.log(response.toSource());
});
}
});
}
邀请朋友();