Facebook,使用发送按钮时出现附件不可用错误?

发布于 2024-12-04 14:32:30 字数 1553 浏览 0 评论 0原文

我使用发送按钮在应用程序上共享链接和消息,但当我尝试阅读消息时收到此错误:

Attachment Unavailable
The privacy settings on this attachment do not allow you to view it.

我收到消息但看不到附件。附件应该是链接!

这是我使用的代码:

<div id="fb-root"></div>
   <script>(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
    </script>
<div class="fb-send" data-href="http://apps.facebook.com/app_profile?id=<?php echo $id;?>" data-font="arial" ></div>

有什么想法吗?

编辑:

我已阅读有关此 Send 按钮的更多信息,并设置了所有 Open Graph 并在我的应用程序中添加了隐私政策 URLLikeShare 按钮工作得很好,

我还添加了 ref 标签,并且基本上尝试了一切。

这是 Facebook 的错误吗?

edit2:

我的fbml代码以及:

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
s = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:send ref="some_ref>" href="http://apps.facebook.com/profile?id=<?php echo $user_profile['id'];?>&amp;ref=some_ref" font="arial">Send private message</fb:send>

I am using the send button to share a link and a message on a app but I get this error when I try to read the message:

Attachment Unavailable
The privacy settings on this attachment do not allow you to view it.

I get the message but can't see the attachment. The attachment should be a link!

Here is the code I use:

<div id="fb-root"></div>
   <script>(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
    </script>
<div class="fb-send" data-href="http://apps.facebook.com/app_profile?id=<?php echo $id;?>" data-font="arial" ></div>

any ideas?

edit:

I've read more about this Send button and I set up all Open Graph and added Privacy Policy URL inside my app. The Like and Share buttons work just fine

I've also added the ref tag and basically tried everything.

Is this a facebook bug?

edit2:

my fbml code as well:

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
s = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:send ref="some_ref>" href="http://apps.facebook.com/profile?id=<?php echo $user_profile['id'];?>&ref=some_ref" font="arial">Send private message</fb:send>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

最笨的告白 2024-12-11 14:32:30

检查您是否有双重 FB.init。我遇到了同样的错误,我发现我已将 FB.init 放置到页面顶部和页脚。

Check that You not have double FB.init. I got the same error and I found that I had put FB.init to top of the page and to the footer too.

沉默的熊 2024-12-11 14:32:30

我只是从 发送按钮 - Facebook 开发人员 获取此代码,但进行了一些编辑适合您的情况

这部分应该位于“body”标签中

<div id="fb-root"></div>
<script>
    (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

“ref”值可以包含字母数字字符和一些标点符号(当前为 +/=-.:_)

<fb:send ref="some_ref" 
        href="http://apps.facebook.com/profile?id=<?=$user_profile['id'];?>" 
        font="arial">Send private message</fb:send>

在使用 FBML 之前,请确保将此 xml 命名空间添加到“html”标签

<html xmlns:fb="https://www.facebook.com/2008/fbml">

如果你使用您可以使用 XHTML 作为 DOCTYPE

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

I get this code simply from Send Button - Facebook Developers but edited little bit to fit your case

This part should be in "body" tag

<div id="fb-root"></div>
<script>
    (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

"ref" value can contain alphanumeric characters and some punctuation (currently +/=-.:_)

<fb:send ref="some_ref" 
        href="http://apps.facebook.com/profile?id=<?=$user_profile['id'];?>" 
        font="arial">Send private message</fb:send>

Before you use FBML, make sure you are adding this xml namespace to "html" tag

<html xmlns:fb="https://www.facebook.com/2008/fbml">

if you use XHTML as DOCTYPE you may use

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
分分钟 2024-12-11 14:32:30

您的代码 ref="some_ref>" 中有 1 个错误 也应该是 ref="some_ref"

,请检查 href 参数是否可以从 fb 服务器访问。

You have 1 error in your code ref="some_ref>" should be ref="some_ref"

also, Please check that the href parameter is accessible from the fb server ..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文