简体   繁体   English

Javascript不向Facebook请求权限

[英]Javascript not requesting permissions from Facebook

and nor giving error when trying to access stuff that is out side of current permissions but just returning user id... 尝试访问当前权限之外但仅返回用户ID的内容时也不会给出错误...

window.fbAsyncInit = function() {

FB.init({appId:'12345myIdHere', status:true, cookie:true, xfbml:true});

FB.Event.subscribe('auth.authResponseChange', function(response) {

 if (response.status === 'connected') {
      testAPI();
      console.log(response);
   } else { testLogin(); }});};

function testLogin() { FB.login({scope: 'user_status'}); }

function testAPI() {
    FB.api('/me/permissions', function(response) { console.log(response); });
    FB.api('/me?fields=statuses', function(response) { console.log(response); });
}

Response from permission show that only basic permissions have been given and in my app settings as a user it also show that app uses no extra permissions. 权限的响应表明,仅给出了基本权限,在我的应用程序设置中,作为用户,它还表明该应用程序未使用任何额外的权限。

Found it..it's the bug in Facebook api...if xfbml is set to true the scope object is completely ignored. 找到它..这是Facebook api中的错误...如果xfbml设置为true,则范围对象将被完全忽略。 So set permissions on login button or use your own login button and change xfbml to false. 因此,请设置登录按钮的权限或使用您自己的登录按钮,然后将xfbml更改为false。

FB.login() not asking for given permissions FB.login()不要求给定权限

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

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