隐私设置,阻止您拉动用户的Facebook喜欢

I have a Facebook Auth login for a user in my web app. For the majority of profiles I try, I am able to pull their likes, friends list and other public information just fine. However, for one user I am finding that I cannot pull their likes or city. His likes and city are publicly available to his friends. This is very strange, and I am assuming it is because of some sort of privacy issue that I am not aware of.

I am already using pagination to get the likes, and as I said, it works for most profiles.

For the city, I am simply using this code (also works for most profiles):

public function getLocation() {
    $user = $this->getUser();
    $data = array();
    $data['citystate'] = isset($user['location']['name']) ? $user['location']['name'] : '';
    $data['citystate'] = explode(", ", $data['citystate']);
    $data['city'] = isset($data['citystate'][0]) ? $data['citystate'][0] : '';
    $data['state'] = isset($data['citystate'][1]) ? $data['citystate'][1] : '';
    $data['state_abbrev'] = isset($data['citystate'][1]) ? StringEdit::convert_state($data['citystate'][1],'abbrev') : '';

    return $data;
}

When a user logs in, they receive this dialog (upon first connection with the app):

App will receive the following info: your public profile, friend list, email address and News Feed.

My question is, is this a permission issue? Or is this a privacy issue? And if either, how do I fix it, and circumvent this. Thank you.

The reason could be both-

  1. Permission Issue

    The different user details demands different permissions. But if these are public for a user then you dont need that permission for that particular user.

    So, while logging in, you should add the permissions: user_location, user_likes in your scope parameter.

  2. Privacy issue

    Its possible that the user has granted the permissions yet the details are not coming. When a user has set some details to not be shown to anyone accept himself in that case graph api wont fetch these details for you. (but since you are sure that the details are available to friend, so this should not be the case)