【问题标题】:Facebook send dialog is not workingFacebook 发送对话框不起作用
【发布时间】:2021-03-09 22:45:36
【问题描述】:

我在 facebook 发送对话框功能方面需要帮助, 发送对话框未显示。我没有收到任何错误,但没有显示发送对话框。
下面的代码有什么问题?

FB.login(function(response) {
    if (response.authResponse) {
        sendDialog();
    }
}

var sendDialog = function()  {
    FB.ui({
        method: 'feed',
        display: 'iframe',
        name: 'sample',
        link: 'https://www.sample.com/'
    });
}   

【问题讨论】:

  • 请编辑语法固定和缩进固定版本以添加详细信息。我们不想再修复这个问题,我无法在差异中发现您的编辑。

标签: facebook facebook-javascript-sdk


【解决方案1】:

你是否在你的 body 标签中使用了以下内容?

<script src="http://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<script>
  // assume we are already logged in
  FB.init({appId: 'xxxxxxxx', xfbml: true, cookie: true});
 FB.ui({
      method: 'send',
      name: 'People Argue Just to Win',
      link: 'url',
      });
</script>

注意:使用method: 'send',

详情请参考:https://developers.facebook.com/docs/reference/dialogs/send/

【讨论】:

  • 是的,我已经使用了这个功能。问题没有显示对话框界面。
  • 你能在 "var sendDialog = function() {" 中放置一些警报吗?它是在调用函数时触发的吗?
  • 我在这个函数中使用了我的 body 标签,window.fbAsyncInit = function() {FB.init({appId: 'xxxxxxxx', xfbml: true, cookie: true}); });我想 response.authResponse 显示发送对话框。
  • @Soojoo,你能帮忙解决一下这个stackoverflow.com/questions/66654709/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-10-12
  • 2012-10-12
  • 2016-11-20
  • 1970-01-01
  • 1970-01-01
  • 2013-09-05
  • 2014-08-02
相关资源
最近更新 更多