出现“请求”对话框但未发送请求

时间:2012-06-19 14:10:25

标签: php javascript facebook-graph-api

我正在尝试使用“apprequest”对话框发送应用请求 使用以下代码

但在此处会出现请求对话框 但请求未发送

var inviteFriends;
       window.fbAsyncInit = function() {
   FB.init({
     appId      : '112312312312321', 
     status     : true,
     channelUrl : '//mysite.com/include/fb/channel.php', 
     cookie     : true, 
      frictionlessRequests : true
   });

   // Additional initialization code here
   FB.getLoginStatus(function(response) {

if (response.status === 'connected') {
   // the user is logged in and connected to your
   // app, and response.authResponse supplies
   // the user's ID, a valid access token, a signed
   // request, and the time the access token
   // and signed request each expire
   console.log('authorized');

   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());

           });
      }

});
} inviteFriends();

0 个答案:

没有答案
相关问题