Facebook登录认证对话框和权限

Facebook Login auth dialog and permissions

本文关键字:权限 对话框 认证 登录 Facebook      更新时间:2023-09-26

我已经在"设置/授权对话框"中为我的应用程序设置了所需的权限。但是,当我添加通用登录按钮

时,它们不会显示出来
  <div id="fb-root"></div>
  <script>
    window.fbAsyncInit = function() {
      FB.init({
        appId      : 'xxx',
        status     : true, 
        cookie     : true,
        xfbml      : true
      });
    };
    (function(d){
       var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
       js = d.createElement('script'); js.id = id; js.async = true;
       js.src = "//connect.facebook.net/en_US/all.js";
       d.getElementsByTagName('head')[0].appendChild(js);
     }(document));
  </script>
  <div class="fb-login-button">Login with Facebook</div>

你需要在你的fb-login-button类div中添加一个"data-perms"属性。

<div class="fb-login-button" data-perms="email,user_checkins">
        Login with Facebook
</div>

这里有一个facebook文档页面的链接,它会告诉你关于它的一切:https://developers.facebook.com/docs/guides/web/

我刚刚粘贴在那里的代码大约在页面的中间。它们向你展示了你需要做什么才能使登录和权限工作。

希望有帮助!

凯尔