开发者

Why is the Facebook login not asking for correct permissions?

I use Facebook login using FB.login (and I don't want to use the Facebook login button). My problem is that after login, the Facebook dialog don't show the listed permission, as follows.

FB.login(function (response) {
   if (response.status == "connected") {
      //alert(" connected ");
   }
   else {
       //alert(" not connected ");
   }
}, { scope: 'email' });

The Facebook dialog show "Access my basic information" only. How do I fix this problem?

Note: if I try the Facebook login, it shows the permission correctly.

Note 2: the response after the user clicks Allow is:

U开发者_如何转开发ser cancelled login or did not fully authorize.


That's because of a mistake in the official documentation. The property name for the permissions is not "scope", but "perms":

FB.login(function (response) {
   if (response.status == "connected") {
      //alert(" connected ");
   }
   else {
       //alert(" not connected ");
   }
}, { perms: 'email' });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜