简体   繁体   中英

Facebook login request permission not now button

In the facebook api when you have a user login to your site using facebook SDK it requests permissions from the user, depending on what your doing email, or users_friends are requested. If a user hits "not now" as far as I can tell it is the same as hitting decline. Is there a way to make it ask again if a user hits the not now option? right now a user logs into facebook, if they hit not now it will return nothing to my site (which is fine I handle that) but then if a user hits login with facebook again it automatically fails them rather than prompting to accept or not now again. Anyway to bypass this? or at least alert the user what's going on?

As mentioned by @CBroe, as per the documentation :

It's OK to ask a person once to grant your app permissions that they've declined. You should have a screen of education on why you think they should grant the permission to you and then re-ask. But if you use the method described in the previous section the Login Dialog won't ask for that permission.

This is because once someone has declined a permission, the Login Dialog will not re-ask them for it unless you explicitly tell the dialog you're re-asking for a declined permission.

You can achieve this by passing the auth_type: rerequest flag:

FB.login(
  function(response) {
    console.log(response);
  },
  {
    scope: 'user_likes',
    auth_type: 'rerequest'
  }
);

However , it's your responsibility to insure a good user-experience and educate the user before showing the dialog again since this may introduce an infinite loop (user declining and you asking again), which is against our policies Platform Policy 7.5 :

If a person declines a permission, you can prompt them again after they indicate an intent to grant you the permission.

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