简体   繁体   English

使用js sdk登录到Facebook

[英]Login with facebook with js sdk

I am trying to do login with facebook but their is an error and is not allowing users to login and the error is ERROR: Can't Load URL: The domain of this URL isn't included in the app's domains. 我正在尝试用Facebook登录,但是他们是错误的,并且不允许用户登录,错误是错误:无法加载URL:此URL的域未包含在应用程序的域中。 To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings. 为了能够加载此URL,请将应用程序的所有域和子域添加到应用程序设置的“应用程序域”字段中。

           <html>
           <head>
             <title>Login with Facebook</title>
           </head>
           <body>

             <div id="fb-root"></div>
             <script>
         window.fbAsyncInit = function() {
           FB.init({
             appId      : '555437747988297',
             channelUrl : '//booknow.drbatras.ae/channel.html', // Channel File
             xfbml      : true,
             version    : 'v2.7'
           });
         };

         (function(d, s, id){
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) {return;}
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_US/sdk.js";
            fjs.parentNode.insertBefore(js, fjs);
          }(document, 'script', 'facebook-jssdk'));
       </script>

         <div class="fb-login-button">Login with Facebook</div>

       </body>

转到facebook的开发者网站->使用您的应用程序的管理员帐户登录,然后从菜单中选择您的应用程序,在该应用程序的“高级设置”标签中添加您的域,然后该错误将不会显示

  • Remove the channelUrl parameter (it is not needed anymore) 删除channelUrl参数(不再需要)
  • Add the "Website" Platform in your App settings, with your URL 在您的应用设置中,使用网址添加“网站”平台
  • Add the domain at "App Domains" in your App settings 在您的应用设置中的“应用域”中添加域

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

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