开发者

Facebook API, get friends from specific location using current_location

I am having trouble finding a user's friends at a specific location using the current_location attribute. This is my query:

SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND  
current_location = 103723936333579

This always returns empty even though I know that many of the user's friends are living at the location with id 103723936333579. I know that current_location is an array, but if I write:

SELECT name FROM user WHERE uid开发者_开发问答 IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND  
current_location.id = 103723936333579

... to get the id of the array I get an error. The dot-notation doesn't seem to be working for me.

Thanks


Facebook FQL queries don't support querying by an array element like you are trying to do. The only way I can think of is to return all users and their current_location field and loop through every user and their current_location value.

You need to prompt the user for friends_checkins extended permission to make sure the current_location value is populated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜