+ Start a Discussion

Problem with facebook Integration

I am trying to use the 'Login with Facebook' button on my visualforce, which will ultimately be used on sites.

But I get the following error:

Error: Unknown component fb:login-button


I already searched the forum and this is the only sample I found:


I tried using the methods in there too, but they didn't work.


Here's my code:

<apex:page >
  <div id="fb-root"></div>
  window.fbAsyncInit = function() {
    FB.init({appId: 'my_app_id', status: true, cookie: true,
             xfbml: true});
    FB.getLoginStatus(function(response) {
      if (response.session) {
        console.log('logged in and connected user, someone you know');
      } else {
        console.log('no user session available, someone you dont know');
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src=document.location.protocol +


<div xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
 <fb:login-button show-faces="false" width="200" max-rows="1"></fb:login-button>
<script src="http://connect.facebook.net/en_US/all.js#appId=147159395362207&amp;xfbml=1"></script>



Can anyone help me out please?


Thanks in advance


Shashikant SharmaShashikant Sharma

See this if it can help you 



Thanks for the link Shashikant. But the blog doesn't talk about logging in using the <fb:login-button> tag.