开发者

Facebook API, get friends from specific location using current_location

开发者 https://www.devze.com 2023-03-21 00:58 出处:网络
I am having trouble finding a user\'s friends at a specific location using the current_location attribute. This is my query:

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

精彩评论

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