I'm correctly loading Facebook SDK with requireJS (https://developers.facebook.com/docs/javascript/howto/requirejs) because I see it in the console log message and because I can publish on users wall using FB.ui method so the hard work has been done ! But the tricky part is missing : I can't display the like and share buttons (https://developers.facebook.com/docs/javascript/quickstart).
I can see :
<div id="fb-root"></div>
is filled in after page load but the :
<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>
doesn't get anything inside !
What am I missing ? an initialization using FB.XX method ? No javascript error so don't know where to dig ...
OK found the answer 5 sec after posting after 1 hour searching ...
thanks to this page : https://github.com/thomaswelton/requirejs-facebook even if I don't use this plugin for now.
In my FB.init, I had to add the line :
xfbml : true
witch, you would certainly agree, it's very very clear that "xfbml" means "please activate my social plugin" ! I love when variable name doesn't means anything ;)
Related
When I click my Like button, it does add the activity to my FB (per screenshot) but the count stays at zero (also per screenshot), why?
I've checked the Linter tool and everything looks to be fine.
The site is www.FindCuro.com
Here is my code (MVC)
<script src="http://connect.facebook.net/en_US/all.js#appId=#ConfigurationManager.AppSettings["FacebookAppId"]&xfbml=1" type="text/javascript"></script>
<div id="fb-root"></div>
<div class="fb-like" data-href="http://www.findcuro.com" data-send="false" data-width="450" data-show-faces="true" data-layout="button_count"></div>
Thanks
The problem is the like button.
<div class="fb-like" data-href="http://www.FindCuro.com" data-send="false" data-width="450" data-show-faces="false" data-layout="button_count"></div>
You shouldn't be using "FindCuro.com" (note the capital letters)
If you check https://graph.facebook.com/http://www.FindCuro.com/ you'll see two shares
If you check https://graph.facebook.com/http://www.findcuro.com/ you won't see any shares
Facebook is checking the second one.
try all lowercases.
The issue is related to the fact that page located on URL you using for like button have Canonical URL that cannot be resolved due to cyclical redirects: http://www.FindCuro.com/ (See output of Debug tool for initial URL and the one for Canonical URL)
Provide lowercase Canonical URL in the OpenGraph meta tags should solve the issue.
BTW, If you'll use standard layout for Like Button you will probably see error message while liking with user who is admin of application. Also activity story about liking page is sent regardless of real like number increase.
I've got an implementation of the Facebook SDK that I'm using in my site. It works great on every browser minus Safari where occasionally the Facebook Connect button won't load.
Looking at the JS errors I'm getting the following messages. They're coming from all.js which is FB's JS library. Anyone got any ideas?
The "fb-root" div has not been created. (all.js Line 3)
TypeError: 'undefined' is not an object (evaluating 'e.root.appendChild') (all.js Line 6)
When working with Facebook's all.js, you need to make sure that you have div with id set to fb-root typically below the body tag. Make sure you have:
......
<body>
<div id="fb-root"></div>
<script>
// facebook js code here
</script>
The error message you have posted clearly says it does not find such div which means you should have it on your page like shown above.
How many fb-root divs do you have? If you have multiple it might confuse the API on the Safari browser.
I'm using the facebook social plugin with an embedded ruby url which references: http://www.facebook.com/pages/my_page/my_page_id Specifically, the like button functionality works, but the send button functionality results in an error.
<div class="fb-like" data-href='<%= #fb_url %>' data-send="true" data-colorscheme="dark" data-width="450" data-show-faces="true"></div>
The page at http://www.facebook.com/pages/my_page/my_page_id could
not be reached because the server returned status code 200.
Have you ever seen this? This doesn't even make sense: a status code 200 is - OK.
Solved the problem:
This is related to URLs that redirect. The like button supports them, the share button does not.
Facebook like button failing. The script displays the button, says i've liked it and increased the like count. But it displays nothing on my account and when I refresh the page it says i haven't. What would cause this?
Code: <fb:like href="http://fbquote.me/like.php?id=<?php print $row['id']; ?>" send="false" layout="button_count"></fb:like>
What's this url : http://fbquote.me/like.php?id=<?php print $row['id']; ?> ??
Do you use PHP ? Why do you use such a url ? Failing likes are often related to url errors
Also Do you load fb javascript ?
Do you have something like
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
Somewhere in your page ?
The fbml below generates an invite form using a multi-friend-selector. Everything works, except the Skip button. No matter what url I place in the action attribute, the action in the rendered form is always blank. This of course causes the Skip button to 404.
<div class="invite">
<fb:serverFbml width="626">
<script type="text/fbml">
<fb:request-form
action="default.asp"
target="_top"
method="POST"
invite="true"
type="My Application"
content="<fb:req-choice url='facebook.com/somepage' label='Authorize my Application'/>">
<fb:multi-friend-selector showborder="true" email_invite="false" cols="4" rows="1" actiontext="Invite your friends to use My Application!">
</fb:multi-friend-selector>
</fb:request-form>
</script>
</fb:serverFbml>
</div>
Edit: On closer inspection, it looks like the 404 it goes to is http://www.facebook.com/plugins/serverfbml.php?. Found this as the only 404 response when tracking in Fiddler.
had the same problem and it was driving me crazy but i managed to fix it.
Try this : <fb:req-choice url='facebook.com/somepage' '
just add another ' right after that, make sure you use space between them. It's funny how I spent 2 hours trying to figure that out. If you wish I'll just copy and paste the whole code. Hope this helps, I'm pretty sure it will since I had the exact same issue. Cheers.
I had the same issue!!!
The fix was the following in my case:
action="http://YOURDOMAINNAME/APP/welcome.htm?${query_string}"
YOURDOMAINNAME must be the same as in your Canvas URL!
Update
Official response from Facebook on my bug report; they've closed it. Only took five months :).
Thanks for the report.
As we are in the process of
deprecating FBML/FBJS, we will not be
adding additional features or fixing
current bugs. If you are creating an
application on facebook.com, please
implement your application using our
supported APIs, SDKs and Social
Plugins. Using these you can embed
many of the same social features
available in FBML.
Please see more at our roadmap:
http://developers.facebook.com/roadmap