脸书应用程序请求:发生错误.请稍后重试


facebook apprequests : An error occurred. Please try again later

我使用此代码向我的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');
                        }
});
}

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

演示

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

好吧,

它没有任何意义,但这段代码工作正常。

我从上一页中删除了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
});