facebook graph api bringing in users public album
Im trying to bring in a user photo album. How do i get the album id? Im using the javascript sdk and gra开发者_运维知识库ph api.
--Mark
You could loop through all the user's albums with this call:
http://graph.facebook.com/-the-users-id-/albums
This will get the album ID for every album for a USER_ID:
SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me() and uid2="USER_ID" )
This will get the src for every image in every album for a USER_ID:
SELECT src FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me() and uid2="USER_ID" ) )
Note the use of "uid1 = me()", without this, FB seems to have a permission issue, even if the current user is signed in.
Also, make sure you ask for permissions when you sign in your user.
http://developers.facebook.com/docs/authentication/permissions/
精彩评论