2012-08-02 86 views
1

我正在一个网站上工作,作为我们允许用户邀请他们的朋友的一部分。使用以下代码Facebook API:发送消息给朋友只适用于测试/管理用户

// assume we are already logged in 
    FB.init({appId: 'xxxxxxxx49030', xfbml: true, cookie: true}); 
    function sendInvites(fb_ids) { 
       var link_url = "<?php echo base_url()?>invited/?code=100627510332492694"; 
       FB.ui({ 
        method: "send", 
        to: fb_ids, 
        name: "Join example.com", 
        description: "hello", 
        picture: "http://www.example.com/images/logo-orange.png", 
        link: link_url 
       }, function(response) { 
        alert(response) 
        if (!response){ 

         return; 
        } 

        $.post("/invite/new/", { 
         fb_ids: fb_ids 
        }, function(data) { 
         if (data.status == "success") { 
          alert(data.status); 
         } else { 
          alert(data.message); 
         } 
        }, "json"); 
       }); 
      } 

不明白缺少什么。

回答

0

Fbids应该是一个数组,我错过了它。现在正在工作。

相关问题