Get your Facebook Cover Photo using FQL

Facebook’s Graph API doesn’t have a method to easily retrieve a cover photo. However, provided that you (or a user) has given your app access to their Photo Albums, you can get the photo pretty easily.

The best way to get it through a single request is using the following FQL query.

SELECT cover_object_id from album where aid IN (SELECT aid, name FROM album WHERE owner=me() AND name="Cover Photos")

Note that you will need an access token to use this query. It definitely works for me, but I’m still testing with permissions to see what’s needed to make it work with other users. Will post an update if anything changes.

Update: Yep, this works. Have it running on my iPhone right now. Remember to change “me()” with the Facebook ID of the user. “me()” will only work from the FQL console.

Cool little Objective-C Method for grouping Facebook likes

Firstly, I just want to say I’m pretty proud of myself for writing compilable code at 4:30am. Go me.

I am making an iOS app as part of my 4th year design project, and we are leveraging Facebook for it. Basically, our app allows you to take a picture of someone’s face and we use facial recognition to pull up their Facebook profile.

Anyway, I was fooling around with the Facebook iOS SDK and one of the things I’ve been wanting to do is to group one’s likes by category. Facebook seems to just return a large array of likes, with no grouping. This little method below groups them so I can have a table view with headings like “Favorite Books”, “Favorite Movies”, etc. Check it out.