Patrioticcow
Patrioticcow

Reputation: 27058

Facebook, Attachment Unavailable error when using the send button?

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>

Upvotes: 2

Views: 5447

Answers (3)

Juicy
Juicy

Reputation: 11

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.

Upvotes: 1

jwchang
jwchang

Reputation: 10864

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

Upvotes: 0

mjs
mjs

Reputation: 657

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

Upvotes: 0

Related Questions