Awais Qarni
Awais Qarni

Reputation: 18006

FB._https not working for https

hello I am having problem related to https://. I have used FB.getLoginStatus(function(response) function in my code. It is only working for http:// but not for https://. I have googled it and found a solution of using FB._https = (window.location.protocol == "https:");. It was working well few days ago but has now stopped working.

My code looks like

 <script>
        FB._https = (window.location.protocol == "https:");
        FB.init({
            appId : '<?php echo $this->appId; ?>',
            status : true, // check login status
            cookie : true, // enable cookies to allow the server to access the session
            xfbml : true // parse XFBML
        });

     function PostAction(custom_action)
     {
        console.log('out side of getlogin status');
        FB.getLoginStatus(function(response)
        {
          console.log("in getlogin status");
          if (response.authResponse) {
             fbcallBack(response);
          } else {
             FB.login(fbcallBack, {scope:'publish_stream'});
        }
      });
   }
</script>

My PostAction() is called on an onclick event. I have written console.log() to debugg the code. console with out side of reglogin status is triggered but not in getlogin status when using facebook with https. But if I am using http:// it works well.

Can any body guide me please what is the problem? how to fix it?

Regards.

Upvotes: 1

Views: 1798

Answers (1)

Graham Smith
Graham Smith

Reputation: 25757

As of yesterday at 22:00 Facebook made this announcement:

http://developers.facebook.com/blog/post/2012/06/20/platform-updates--operation-developer-love/

As announced in May, we have updated the Javascript SDK to limit the publicly exposed interface. This is part of an ongoing process to improve the reliability of the SDK. We have removed access to all internal properties and to methods prefixed with _.

If you are currently relying on accessing internal properties, please refactor this so that you only rely on the publicly available (and officially supported) methods listed at https://developers.facebook.com/docs/reference/javascript/.

Note that all methods not listed as part of the public API might be subject to change or removal, and you should not use them directly.

Upvotes: 4

Related Questions