Graph API will not return friends religion

I have a screen where users can select Facebook friends. After submitting the form, I request a profile object from Facebook with certain fields (for example: https://graph.facebook.com/some_id?fields=id,name,religion&access_token=xxx ).

When I request my own profile data with the religion field in the query, I see that the value is correctly included in the result. When I request my friends' profile information, the answer does not include their religion, although I can see it by directly viewing their profile page.

I made sure that I am requesting user_religion_politics and friends_religion_politics before making this call (and using the updated access token). What's happening?

0
source share
1 answer

After creating two test user accounts, it seems that one of two things must be correct in order to access a friendโ€™s religion through the Graph API:

  • A friend must make his religious information "Public." For example, installing it in Friends of Friends is not enough to allow him to get the API for any reason, regardless of our friendship.

  • A friend must allow the permission of the friends_religion_politics application. Having allowed this permission on my account, I do not tell Facebook that I want to allow access to information about my religion. Instead, I tell Facebook that I want to share my own religion information with other friends who request it through the Graph API.

The second point is a very important difference, and I would like it to be stated in the documentation as such. Permission, in fact, is useless for my needs, as now, unfortunately.

0
source

Source: https://habr.com/ru/post/1335710/


All Articles