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.
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 appxyz
to access his locationI hope this answers your question.
Try this query to get current location of your friends
Also u will need friends_location permission to run this query
Same issue here. I can retrieve current_location or hometown_location for NONE of my friends. For most of them I can easily see it by visiting their profile though. App permissions friends_location and friends_hometown are set.
There are 2 possibilities; The friends of the user who have current_location null :
I have the same problem.
I've checked two different users which are friends of me.
In both cases FQL query like:
returns
null
forhome_location
.I'd checked both accounts and home location was accessible for all (both privacy and app privacy settings).
My access token included all required permissions (home location was shown for other friends).
Then I run FQL console with query:
as owner and the results were:
After a while I got home location on old FQL console.
But old queries still didn't return home location...
Seems like some caching problem on FB side.