5

I can't find anywhere an fql query to list my facebook friends according to a location I that I specify.I am trying to implement this fql query in android.Someone please help me.

sharath
  • 521
  • 1
  • 4
  • 18

1 Answers1

3

The FQL you are looking for will be

select name, current_location
from user 
where uid in (select uid2 from friend where uid1 = me()) 
  and current_location.country = "India" 
  and current_location.state ="Delhi"

The above FQL filters out the friends of the user and returns list of user's friends with current_location as Delhi, India. You can further filter the list based on other attributes of current_location like city, zip, latitude, longitude and others.

You would require the additional friends_location permission to access the location from the User FQL table.

Anvesh Saxena
  • 4,458
  • 2
  • 23
  • 30
  • String fqlQuery = "SELECT uid, name FROM user WHERE uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND hometown_location.country='"+location+"'"; This is my android side fql query but still i am not able to get the result – sharath Jul 18 '13 at 09:17
  • When i write this fql query i get the result but the search includes myself too and when i remove the part " uid = me() OR" i dont get any result – sharath Jul 18 '13 at 09:26
  • As per your comments, I think you are not having the permission for `friends_hometown`. – Anvesh Saxena Jul 18 '13 at 13:39