Facebook graph api friends_religion_politics resolution problems

I work with facebook graph api trying to get users religion and political sphere. I have the friends_religion_politics permission set and signed up, but when I test the application on my account, I get only one of my friends religion and political fields.

The general request that I make is: https://graph.facebook.com/me/friends?access_token=%3Ctoken%3E&fields=religion,political

Vaguely enough when I run away that I have 4 friends, religion and political views, but still far from all of these.

Am I doing something wrong in permissions or is it something like the default privacy settings that prevent applications from accessing these fields?

+4
source share
5 answers

Facebook's privacy settings allow users to leave their friends' apps from collecting a large amount of information, including political and religious views. That's why sometimes they provide information in their profiles, and yet applications still do not retrieve this data.

You can find this by going to Facebook’s privacy settings (click the triangle down in the upper right corner and select “Privacy Settings.”) Click “Change Settings” next to “Ads, Applications, and Websites.” “One of the options that you can change is called“ How people bring your information to the applications that they use. ”This option allows people to check or remove a lot of boxes from the screen, depending on what information they want to share with the applications that used by their friends.

Many people seem to prefer not to share their religious and political views with the apps. But it seems your method of obtaining data is the correct method.

+2
source

I checked with my friends and the information is coming in correctly ... those who provided this specific information ...

using api chart

0
source

If you get the values ​​of your four friends, then your code is working correctly. Facebook retrieves information from its spreadsheets if the information exists. If you do not receive value from other friends, it means that they did not provide this information in their profiles. You just check your profiles. Your code is incorrect if they have information in their profiles, but you do not receive.

0
source

I’m not sure that the access token has the necessary permission to obtain political views. The fact that you get 4 friends whose political views you see does not mean that the resolution setting is working correctly.

When I asked my friends for a political look from the Facebook reference api site, I was able to get the political views of my two friends. Perhaps these two friends set up their privacy setting so that everyone can see their political opinion. (By the way, the political opponent of both of these friends was “political”: “Not interested in politics (Nil),”).

I will create a test case. In case you have a friend who will help you, you can ask him to open his political opinion, and then ask again. Also, ask one of your friends whose political vision is already visible on your statement to see if he has configured his privacy setting.

I also hope that you have an expiring access token. Perhaps you have offline_access permission and this creates a long access token. If you think this might be your problem, try invalidating your token.

0
source

I also tried to get the religion of my friends, but I never get value for this area.

Of course, I have the permission of friends_religion_politics.

I tried both the Graph API and the FQL query.

https://graph.facebook.com/me/friends?access_token=xxx&fields=religion,political -> just retunrs ids friends, nothing more.

Is there a problem with the API?

0
source

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


All Articles