sharath
sharath

Reputation: 521

how to write an fql query to list friends in a particular location

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.

Upvotes: 5

Views: 1193

Answers (1)

Anvesh Saxena
Anvesh Saxena

Reputation: 4466

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.

Upvotes: 3

Related Questions