facebookxfbml

xfbml form does not render


I am trying to use javascript sdk for rendering a XFBML form on our site and i keep getting

Unable to load the registration form for . You may have previously blocked this app on Facebook. Go to your Facebook privacy settings to unblock this app. (Error: Invalid 'client_id'.)

my app is registered and with correct id.

the code looks like is:

<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '118446328234891', // App ID
      channelUrl : '//www.sakshum.org/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>
<script src="https://connect.facebook.net/en_US/all.js#appId=118446328234891&xfbml=1"></script>

<fb:registration fields="name,birthday,gender,location,email" redirect-uri="http%3A%2F%2Fwww.sakshum.org%2FFbValidation" width="530">
</fb:registration>

just to add on if i use non xfbml version using just iframe then all works fine.


Solution

  • Looks like the issue was using encoded redirect_uri. changing it to normal url fixed the issue.