1

我正在开发一个网站,作为其中的一部分,我们允许用户邀请他们的朋友。使用以下代码

// 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");
                });
            }

不明白缺少什么。

4

1 回答 1

0

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

于 2013-10-25T09:37:47.170 回答