0

我正在使用此代码向我的 Facebook 应用程序中的用户发送应用程序请求

<script src="https://connect.facebook.net/en_US/all.js"></script>


    <script type="text/javascript">

     window.fbAsyncInit = function() {
     FB.init({
         appId: '39764546513545342',
         status: true,
         cookie: true,
         oauth: true
     });
 };


           function invitetoevent(rid)
               {
              FB.ui({
                   method: 'apprequests',
                   message: 'i\'ll see you in this event.',
            title: 'Lets Go!.',
            filters: ['app_users'],
            max_recipients: 25,
                },
                 function (response) {
                        if (response.request && response.to) 
                            {
                //actions
                            } 
                        else 
                        {
                            //alert('canceled');
                        }
});

}
4

2 回答 2

0

看起来您使用过滤器的方式是错误的。

演示

PS:假设你的回调函数是正确的

于 2012-05-13T21:20:34.037 回答
0

好吧,这没有任何意义,但是这段代码可以正常工作。

我从上一页删除了 facebook 脚本加载并使用了此代码。

window.fbAsyncInit = function() {
FB.init({
  appId      : '397334655643214', // App ID
  channelUrl : '//www.itradegame.com/channel.html', // Channel File
  status     : true, // check login status
  cookie     : true, // enable cookies to allow the server to access the session
  xfbml      : true  // parse XFBML
});
于 2012-05-15T05:33:39.413 回答