fb:comment does not work on my application - facebook

I'm a new Facebook developer. I want to add comments box to my application and I follow the tutorial in Facebook wiki. It's not work in my application.
My canvas callback URL is http://122.155.0.71/~facebook/ and I upload xd_receiver.htm to root directory. I am using the following code
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2" type="text/javascript"></script>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
<fb:comments> </fb:comments>
<script type="text/javascript">FB.init("b6e07896a1d0889d9784dea150802587", "/xd_receiver.htm");</script>
in my application. It not show up. When I view this page with Firebug. I see <fb:comments> </fb:comments>. I don't know about xid, where can I create it?

This tag allow user to post comments in my FBML and display these comments on their Wall. But for some cause, comments can not be displayed in users' Wall even they checked the box "Post comment to my Facebook profile".
I don't know what was wrong with the code
I really appreciate if you can help.
This is my FBML: click here to view
And this is my code:
<fb:comments xid="comment" " canpost="true" candelete="false" numpost="10" publish_feed="true"><fb:title>Comment</fb:title></fb:comments>

I'm working on an iFrame XFBML application and had trouble getting this to work until I realized what it meant for the fb:comments tag to be an "unsupported" XFBML tag. To get this working, you have to wrap the fb:comments call in fb:serverFbml tags.
Here's the full code:
<fb:serverFbml style="margin-top:15px;">
<script type="text/fbml">
<fb:fbml>
<fb:comments xid="project_1" publish_feed="false" showform="true" canpost="true" numposts="50" width="467px"><fb:title>Comment on this project</fb:title></fb:comments>
</fb:fbml>
</script>
</fb:serverFbml>

if you want comment box like this in my app
http://apps.facebook.com/pollonfb
then it very easy ,
just use following code
<fb:comments xid="Identifier" canpost="true" candelete="false" returnurl="http://apps.facebook.com/myapp/titans/">
<fb:title>Talk about the Titans</fb:title>
</fb:comments
XId id simply a unique string to identify your comment box uniquely , For example in my app there is a comment box for each poll , and poll name is xid for their comment box.

Related

Facebook Open Graph share issue

I have Facebook share button on my Wordpress site. I have the open graph call in my functions.php. The problem I'm having is when you press the share button below a single post you get the meta description of the site from header.php along with a random image posted to Facebook.
When you use twitter which I have linked to my Facebook page you all the meta info along with the correct image for that particular post the same with a Facebook linked Pinterest account.
I've used the Facebook developer tool scraped various post URL and the all came back with the correct meta info and image error free. Can anyone explain this issue to me.
I figured out what the issue was.
Posting solution in case anyone might come across the same problem.
add: <?php the_permalink(); ?> to the data-href= URL:
<div class="fb-share-button" data-href="<?php the_permalink(); ?>" data-layout="button"></div>
oppose to:
<div class="fb-share-button" data-href="YOUR SITE URL" data-layout="button"></div>
This will load all pertinent info into the Facebook Iframe for Facebook Posting.

Want the facebook comment box url dynamically assigned according to posts

I am working to create a website using wordpress. There are a number of posts in my web site. I am to add the facebook comment button that appears below every single posts in my site. For this purpose I used the facebook social plugin.
I added the codes generated at facebook developers site to my single post page file. Now the problem is: The same comments appear in every page in my posts everywhere. how can I make this a specific one .
<div class="fb-comments" data-href="http://rabindraadhikari.com" data-width="600" data-numposts="3" data-colorscheme="light"></div>
I want to change the data-href part of the code so that it assigns the url according to the page where it is displayed.
The format of the posts url belonging my site is www.domain-name.com/post-id
How can it be done??
Somewhere, I found it can be done like this but it didnt work
<div class="fb-comments" data-href="+location.href+" data-num-posts="3" data-width="470"></div>
location.href is a property from javascript, so
<script>
document.write('<div class="fb-comments" data-href="'+location.href+'" data-num-posts="3" data-width="470"></div>');
</script>

add app to facebook fan page error

I am trying to add an app to my facebook fan page account for oAuth login.
I DONT WANT A TAB so the method i thought might work was method: 'apprequests'
but i keep getting an error: An error occurred with Prayerfish Login. Please try again later.
any suggestions on how to get the app over to my fan page?
note** this html page is from facebooks tutorial
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>My Add to Page Dialog Page</title>
</head>
<body>
<div id='fb-root'></div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p><a onclick='addToPage(); return false;'>Add to Page</a></p>
<p id='msg'></p>
<script>
FB.init({appId: "****************", status: true, cookie: true});
function addToPage() {
// calling the API ...
var obj = {
//method: 'pagetab',
method: 'apprequests',
redirect_uri: 'https://www.myDomain.com',
};
FB.ui(obj);
}
</script>
</body>
</html>
The only way to have an app on a Facebook Page is to add it as a "tab". Since the switch to Timeline, tab has become a bit of a misnomer as it is more correct that it is just a bookmark at the top of your Page (for example on Spotify's Page the 'Get Spotify', 'Fan Playlist' and 'Summer Sounds' thumbnails at the top of the page are technically 'Page Tabs').
If you still want to add the app to your Page as a 'tab', the code you included above is actually more complex than you need. That code is what you would include on your website, for example, if you wanted to allow admins of other Facebook Pages to install your app. Because you own both the Page and the app, you just need to modify this link to include your app ID and URL and click on it:
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&display=popup&next=YOUR_APP_URL
When you do, you'll see a dialog asking you to pick which Page you want to add the app to, choose that and you're done.
If you were already aware of what a Page Tab is and don't want that, my question would be - how do you want the app to appear?

Facebook like button count not updating at all

I'm having a problem with the good ol' facebook like button on my site. I've implemented it all, I can click on "like" and it appears on my wall (and on the site the count pops up to say "1"), but the count never updates. If I refresh the page it just shows the "like" button again (no count), and if I log in to facebook with a new account and click on like again, it just says "1" again.
An example page on my site:
http://www.makemeacocktail.com/recipe/6741/
The fql readout (watch the apostrophe escape here, copy and paste dont just click):
https://api.facebook.com/method/fql.query?query=select%20total_count,like_count,comment_count,share_count,click_count%20from%20link_stat%20where%20url='http://www.makemeacocktail.com/recipe/6741/'&format=json
The FB XML that is being used:
<fb:like href="http://www.makemeacocktail.com/recipe/6741/" send="false" layout="button_count" width="50" show_faces="false" font="arial"></fb:like>
Other facebook thoughts etc:
I've got the facebook open graph meta data in the head
The js call to facebook happens as the last thing on my page, after the FBML:
<script src="http://connect.facebook.net/en_US/all.js#appId=187430904631019&xfbml=1"></script>
<script>
FB.init({
appId : '187430904631019',
status : true,
cookie : true,
xfbml : true
});
</script>
I've also got the facebook page like at the bottom of my page:
<div id="fb-root"></div><fb:like-box href="http://www.facebook.com/makemeacocktail" width="292" show_faces="false" stream="false" header="true"></fb:like-box>
Which is where the fb-root is.
My only thought it something about fb-root not being next to the facebook like button earlier up, and a conflict of two facebook like buttons or something? I;m only calling the facebook js once though, right at the bottom.
Any thoughts help etc much appreciated. It is weird because it it going to my wall, but the button on the site isn't listening!
Thanks a lot
Got this from the request your like button sends to facebook:
App ID does not match domain","full":"The app ID specified
within the \"fb:app_id\" meta tag is
not allowed on this domain. You must
setup the Connect Base Domains for
your app to be a prefix of
http:\/\/www.makemeacocktail.com\/recipe\/6741\/
So, you need to change the base domain for your application in the developers application to makemeacocktail.com. If that is not the problem try removing the fb:app_id open graph tag, or use the fb:admins tag instead. Good luck, hope this helps.

Facebook like button shows same # of likes on every page

I thought the like button was supposed to show a number of likes per page and not per site. Am I correct?
I put the like button on my site http://www.hikingsanfrancisco.com and if you look at different pages of the site, they all show the same number of likes as though it is a universal number for the entire site.
My like button code is in the header div and I suspect the repetition may be happening because of that.
Any ideas/thoughts?
Thank you!
You can use the XFBML version, which will like the current page if the href is not specified:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like layout="button_count" show_faces="false" width="450"></fb:like>
hi dear its just because that you are using the same url on every page. You can set your your dynamically.
<iframe src="http://www.facebook.com/widgets/like.php?href=<?php echo('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px; background-color:#CCCCCC"></iframe>
I hope it will work
This page will show you how to set it up so each page URL can be liked.
Facebook reference document
I think the problem must be other, because I'm using the following
< fb:like href="http://tienditas.net/{{storename}}/{{productoid}}" send="true" width="320" show_faces="true" font=""></fb:like>"
Which produces a unique URL for each page "like" button, and still have the same problem about showing a universal number for the entire site.