Facebook,使用发送按钮时出现附件不可用错误?
我使用发送按钮在应用程序上共享链接和消息,但当我尝试阅读消息时收到此错误:
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
并在我的应用程序中添加了隐私政策 URL
。 Like
和 Share
按钮工作得很好,
我还添加了 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'];?>&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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查您是否有双重
FB.init
。我遇到了同样的错误,我发现我已将 FB.init 放置到页面顶部和页脚。Check that You not have double
FB.init
. I got the same error and I found that I had putFB.init
to top of the page and to the footer too.我只是从 发送按钮 - Facebook 开发人员 获取此代码,但进行了一些编辑适合您的情况
这部分应该位于“body”标签中
“ref”值可以包含字母数字字符和一些标点符号(当前为 +/=-.:_)
在使用 FBML 之前,请确保将此 xml 命名空间添加到“html”标签
如果你使用您可以使用 XHTML 作为 DOCTYPE
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
"ref" value can contain alphanumeric characters and some punctuation (currently +/=-.:_)
Before you use FBML, make sure you are adding this xml namespace to "html" tag
if you use XHTML as DOCTYPE you may use
您的代码 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 ..