2

我正在从我的应用程序(网站)通过 facebook 发送一条私人消息。这是一个网站的邀请链接 - 但是,它给出了以下错误:

The website encountered an error while retrieving https://www.facebook.com/dialog/send. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition 

正在发送的链接邀请链接类似于 http://myapp.com/invitation - 无效 http://myapp.com - 有效!

如何在正斜杠后使它与某些东西一起工作?

实际代码:

  :javascript
    $(function(){
      $('li.friend:not(.invited) label').live('click', function() {
        FB.init({appId: #{Rails.application.config.fb_app_id}, xfbml: true, cookie: true})
        FB.ui({
          method: 'send',
          display: 'popup',
          name: 'New Invitation',
          link: 'http://myapp.com/invitation/',
          to: this.parentNode.getAttribute("data-id"),
          frictionlessRequests:true,
          show_error: 'true'
        })
        $(this).parent().addClass("invited")
        $(this).siblings().prop("checked", true)
      })
    });
4

1 回答 1

1

你有'frictionlessRequests'和'method:send';这些不是兼容的选项。,frictionlessRequests: true应该在您的 FB.init() 调用中,并在预填充收件人时影响请求对话框的工作方式,您所拥有的是来自不同对话框的参数的混合

示例发送对话框调用是:

  FB.ui({
          method: 'send',
          name: 'People Argue Just to Win',
          link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html',
          });

和一个示例apprequests 对话框

FB.ui({
    method: 'apprequests',
    message: 'Come use this app with me.'
  });
}

此外(如您所见)链接需要正确解析返回 200 响应;如果它立即重定向,它将无法正常工作

于 2012-05-07T19:02:53.057 回答