Support » Plugin: Social Ring (Facebook Like, Google +1, ReTweet, LinkedIn and Pin It) » FB.getLoginStatus() called before calling FB.init()

  • @niccolo_tapparo

    Hi I have found a problem, cause by facebook’s all.js returning this to the console:

    FB.getLoginStatus() called before calling FB.init().

    This is most likely because you aren’t loading the SDK asnchronously.
    Can I suggest you try replacing

    <div id="fb-root"></div><script src="<?php echo $this->options['facebook_language']; ?>/all.js#xfbml=1"></script>

    in library.php (function add_footer_js()) with

    <div id="fb-root"></div><script type="text/javascript">
    	        appId  : 'YOUR APP ID',
    	        status : true, // check login status
    	        cookie : true, // enable cookies to allow the server to access the session
    	        xfbml  : true, // parse XFBML
    	        oauth  : true
    	// Load the SDK Asynchronously
    		var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
    		if (d.getElementById(id)) {return;}
    		js = d.createElement('script'); = id; js.async = true;
    		js.src = \"//<?php echo $this->options['facebook_language']; ?>/all.js#xfbml=1\";
    		ref.parentNode.insertBefore(js, ref);

    I would like to have done this myself but I cannot find an app ID anywhere.

    Also, in function add_footer_js(), you should only load the scripts that are necessary – using

    if($this->options['social_X_button'] == 1) {
       //load script

    Thanks in advance,

    P.S please try and get back to me asap, thanks

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘FB.getLoginStatus() called before calling FB.init()’ is closed to new replies.