How to I get all the checkins a user is tagged in using FQL

605 Views Asked by At

Using the graph api it's possible to do:

https://graph.facebook.com/me/checkins

But how am I supposed to do it with FQL? I tried this which suggests:

SELECT message FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) 
AND me() IN tagged_uids

but it doesn't return even a single result.

Thanks.

2

There are 2 best solutions below

0
On BEST ANSWER

From what I can see, IN doesn't seem to work with me(). You have to first get the user id and assign this to a variable. This throws an OAuth exception:

SELECT message FROM checkin WHERE author_uid = me() OR me() IN tagged_ids

but if you set [UserId] to the current user's id, this works:

SELECT message FROM checkin WHERE author_uid = [UserId] OR [UserId] IN tagged_ids

You don't need to use the friend subquery. FQL will only return checkins that are visible to your user.

For this to work, make sure your access_token has both the user_checkins and friends_checkins permissions.

0
On

@cpilko gave a solution, but I've found another one, so I am adding it here as a reference for whoever reach this page:

SELECT id FROM location_post WHERE ([UserId] IN tagged_uids OR author_uid=me()) AND strpos(type,"checkin")>=0