FB Graph / FQL: Friends current_location sometimes reads Null when FB page shows location

I'm trying to get the current location of the user's friends on facebook, and I come across a curious problem, when some of these friends are reading a NULL, when I can see their real pages Facebook, he says, "lives" in , . β€œThe hard part of this error is that it only occurs in ~ ~ 30% of cases. In the remaining cases, it extracts all the correct information, which tells me that the permissions are probably configured correctly.

To be specific, the FQL code I use is:

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

The same problem arose when creating javascript queries directly on the chart, therefore it is also not a FQL problem. Does anyone know why current_location can sometimes fail and report NULL, but not always?

Thank.

+5
source share
5 answers

Privacy settings have a higher priority than facebook api.

If the user has limited certain information from the privacy setting, you will not be able to get it using the facebook api (graph, fql, rest api), even if the user grants permission to do so.

eg.

If I have a restriction on using my birthday in privacy settings, no application can capture my birthday, even if he asks for it.

, .

. xyz , , xyz

, .

+2

2 ; , current_location null:

1) facebook

2) facebook,

0

.

, .

FQL :

select uid, first_name, name, birthday, birthday_date, current_address, current_location, hometown_location, sex from user where uid in (select uid2 from friend where uid1 = me()

null home_location.

, ( ).

( ).

FQL :

select uid, first_name, name, birthday, birthday_date, current_address, current_location, hometown_location, sex from user where uid = nnnn

, :

  • .
  • FQL .
  • FQL .

FQL.

- ...

FB.

0

Same problem. I can get current_location or hometown_location for NONE of my friends. For most of them, I can easily see him by visiting their profile. Permissions are available for friends_location and friends_hometown.

0
source

Try this query to get your friends current location.

SELECT first_name,uid, last_name, current_location.name 
FROM user 
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND current_location

In addition, you will need friends_location to complete this request .

0
source

All Articles