Facebook, Attachment Unavailable error when using the send button?

半世苍凉 提交于 2019-12-11 02:58:54

问题


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'];?>&amp;ref=some_ref" font="arial">Send private message</fb:send>

回答1:


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">



回答2:


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.




回答3:


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 ..



来源:https://stackoverflow.com/questions/7385141/facebook-attachment-unavailable-error-when-using-the-send-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!