简体   繁体   中英

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...

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. So set permissions on login button or use your own login button and change xfbml to false.

FB.login() not asking for given permissions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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