I want to get my friends which belongs to my city from facebook and for this i use current_location.city. But its not working... please help me. Thanks
Asked
Active
Viewed 4,506 times
1
-
there is something in your code – Your Common Sense May 12 '10 at 13:13
4 Answers
3
This FQL query works for me. It returns an array of each user's {uid, current_location} where the current_location includes text of the city that I want.
SELECT uid, current_location FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND 'Seattle' in current_location
Change 'Seattle' to whatever city you'd like, or use a variable to grab the city name from the current user.

ckbhodge
- 913
- 2
- 9
- 19
1
Try this :
SELECT uid, name, current_location.city
FROM user
WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me())
AND current_location.city in (SELECT current_location.city FROM user WHERE uid = me())

nyzm
- 2,787
- 3
- 24
- 30
1
You need user's extended permission for current location. Until user approved current location extended permission you can't retrieve it.
You can check the latest graph api base tutorial from here: http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/

Mahmud Ahsan
- 1,755
- 19
- 18
0
The FQL query is simple:
SELECT current_location FROM user WHERE uid = ID_HERE
The returned value is an array - maybe that's why you're off.
The questions are:
- has the user filled out the location
- do privacy settings permit you to access it
Share some code in your question, and someone might be able to help.

Till
- 22,236
- 4
- 59
- 89
-
I got the current_location values in array. But I want only city or only state is it possible?? – Ashish Jagnani May 14 '10 at 12:59