简体   繁体   中英

Facebook api permissions scope issue

I have this log in script

$('#getFbImg').click(function () {
        FB.getLoginStatus(function(response) {
            if (response.status === 'connected') {
                var uid = response.authResponse.userID;
                var accessToken = response.authResponse.accessToken;
                getPermissions(uid);
                getUserAlbums(uid);
                getUserUploads(uid);
            } 
            else if (response.status === 'not_authorized') {
                // the user is logged in to Facebook, 
                // but has not authenticated your app
            } 
            else {
                // the user isn't logged in to Facebook.
                FB.login(function(response) {
                    if (response.authResponse) {
                        var uid = response.authResponse.userID;
                        var accessToken = response.authResponse.accessToken;
                        getPermissions(uid);
                        getUserAlbums(uid);
                        getUserUploads(uid);
                    } else {
                        console.log('User cancelled login or did not fully authorize.');
                    }
                }, {scope: 'public_profile,user_photos'});
            }
        });
    });

which asks the user to log in in order to continue. The popup window works fine, logs in fine, but the permissions dont seem to be registered. The very weird part is that for my account (which is also the admin in the app) was asked for the permissions, but every other account is not. here is a picture with the permissions object 在此输入图像描述

edit: if I add another permission to the scope eg user birthday, my account gets asked to accept the access of the new permission, but no other account is asked for this.

2nd edit: i added a few other administrator accounts to check if it is because i am the administrator, and i still get the permission problem, the application does not give access to their user_photos, but it still gives to my account

I guess you're using the Graph API v2.0, and haven't yet had your user_likes and user_photos permissions approved for your app: https://developers.facebook.com/docs/apps/changelog#v2_0_permissions

Apps using Facebook Login that require more than public_profile (default), email and user_friends will require review by Facebook in order to request these permissions from people.

Have a look at https://developers.facebook.com/docs/apps/review for the Review process.

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