fbi .login()没有请求给定的权限

FB.login() not asking for given permissions

本文关键字:权限 请求 login fbi      更新时间:2023-09-26

登录正在工作,但它只要求基本权限,并且在取消或完成对话框时不会触发警报。

 window.fbAsyncInit = function() {
    // init the FB JS SDK
    FB.init({
      appId      : 'XXX', // App ID from the App Dashboard
      channelUrl : 'XXX', // Channel File for x-domain communication
      cookie     : true, // set sessions cookies to allow your server to access the session?
      xfbml      : true,  // parse XFBML tags on this page?
      frictionlessRequests: true,
      oauth: true
    });
     FB.login(function(response) {
       if (response.authResponse) {
         alert("ok");
       } else {
        alert("canceled");
       }
     }, {scope:'publish_actions,publish_stream'});
  };

您是否使用fb:login-button?如果是这样,您是否尝试在那里添加权限而不是在FB.login()中添加权限?所以它看起来像这样:

<fb:login-button scope="publish_actions,publish_stream"></fb:login-button>

重要提示:如果你的Facebook应用程序是公开的,那么如果你还没有这样做,那么就向Facebook提交你想要的审查许可。检查你的开发者仪表盘。如果你正处于开发阶段,不要让应用公开,也不要通过Facebook dashboard添加用户进行测试。

我不知道你是否会使用OG Actions,如果没有,你应该阅读关于publish_actions/publish_stream: http://developers.facebook.com/blog/post/2012/04/25/streamlining-publish_stream-and-publish_actions-permissions/

关于警报的问题,请尝试删除oauth变量