Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FB Graph / FQL: Current_location of friends is sometimes reading Null when FB page shows a location

I am attempting to pull the current location of all of a user's friends on facebook, and am running into a curious problem wherein some of those friends are reading out NULL when I can see on their actual Facebook pages that it says "Lives in ,." The difficult part of this error is that it only happens on probably ~30% of cases. On the remaining cases, it pulls all of the correct information, which tells me that the permissions are probably set up correctly.

To be specific, the FQL code I am using is:

SELECT uid,
       name,
       current_location
FROM   USER
WHERE  uid IN (SELECT uid2
               FROM   friend
               WHERE  uid1 = Me())

This same issue has arisen when making javascript requests directly to the graph, so it doesn't appear to be an FQL issue either. Does anyone know why current_location might sometimes fail and report NULL, but not always?

Thank you.

like image 695
Zach Kagin Avatar asked Nov 05 '22 00:11

Zach Kagin


1 Answers

Privacy settings have a higher priority than facebook api's.

If user has restricted particular info from privacy setting, you wont be able to fetch that by facebook api's (graph, fql, rest api) even if user grants permission for that.

e.g.

If I have restricted to share my birthday on privacy setting, no app would be able to grab my birthday even if they ask for it.

Also, user can restrict apps from getting particular info.

e.g. User can allow app xyz to access everything they want but at the same time user can restrict app xyz to access his location

I hope this answers your question.

like image 178
Jashwant Avatar answered Nov 09 '22 08:11

Jashwant