简体   繁体   English

使用Facebook帐户登录到应用程序

[英]login to the application using facebook account

I am connecting to facebook from my application using "https://ssl.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" Now its not working. 我正在使用“ https://ssl.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php”从我的应用程序连接到Facebook,现在它不起作用。 When i make it http its working fine. 当我使它http正常工作。 what is the reason for this? 这是什么原因? How to make it work with https. 如何使其与https一起使用。 is facebook changed the url... here is my code... 是facebook更改了网址...这是我的代码...

The old featureloader JS SDK is deprecated and i thought was already removed - if it's still working, you should stop using it immediately and look at the current SDK and documentation to see how to implement login. 不推荐使用旧的功能加载器JS SDK,我认为它已被删除-如果它仍在工作,则应立即停止使用它,并查看当前的SDK和文档以了解如何实现登录。

For a start, the method of including the current JS SDK is: 首先,包括当前JS SDK的方法是:

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'YOUR_APP_ID', // App ID
      channelUrl : '//WWW.YOUR_DOMAIN.COM/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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM