Get Albums of friends

Aug 25, 2010 at 6:55 AM

Im trying to get photoalbums of my friends with the following code:

 

public FriendViewer()
{
InitializeComponent();
facebookService1.ApplicationKey = Settings.Default.api_key;
            facebookService1.ConnectToFacebook(new List<Enums.ExtendedPermissions>() { Enums.ExtendedPermissions.read_stream, Enums.ExtendedPermissions.publish_stream, Enums.ExtendedPermissions.user_photos,Enums.ExtendedPermissions.read_stream});
}

private void TestService_Load(object sender, EventArgs e)
{

try
{
var friends = facebookService1.Friends.GetUserObjects();
                var albums = facebookService1.Photos.GetAlbums(friends[6].uid.Value);
}

However albums return 0 in count. Am I missing an extendedpermission or is it something else? 

  • I'm using the latest version of the Toolkit
  • I have no problem viewing my friends albums when on Facebook otherwise
  • I it works fine with this code to get my own albums.
  • I have updated the enumeration in the source code with Enums.ExtendedPermissions.user_photos as read in another post in the forum

Anyone have some guidance?

 

Aug 29, 2010 at 8:58 AM

Hi,

I had a piece of FQL-code that stopped working after the recent Facebook API/permission changes. All it did was get the album id's counts, etc, i.e. not accessing the photos themselves. The same code still works if you have all possible permissions. The point being that the recent changes did affect the album access policy, and depending how the SDK implemented it could be the same problem. You could try to either get extended permissions or use the Graph API methods.

Matta

 

Dec 7, 2010 at 5:57 PM
Edited Dec 7, 2010 at 5:59 PM

I'm going to guess that your extended permissions has not been updated in a while

if your using the source and not the dll's you can update this fairly easy. I recently updated my project after taking a look at the facebook developer documentation.

 
Dec 7, 2010 at 5:58 PM
Edited Dec 7, 2010 at 5:59 PM

 /// <summary>
        /// Extended Permissions
        /// </summary>
        public enum ExtendedPermissions
        {
            /// <summary>
            /// Provides access to the "About Me" section of the profile in the about property
            /// </summary>
            user_about_me,
            /// <summary>
            /// Provides access to the user's list of activities as the activities connection
            /// </summary>
            user_activities,
            /// <summary>
            /// Provides access to the birthday with year as the birthday_date property
            /// </summary>
            user_birthday,
            /// <summary>
            /// Provides access to education history as the education property
            /// </summary>
            user_education_history,
            /// <summary>
            /// Provides access to the list of events the user is attending as the events connection
            /// </summary>
            user_events,
            /// <summary>
            /// Provides access to the list of groups the user is a member of as the groups connection
            /// </summary>
            user_groups,
            /// <summary>
            /// Provides access to the user's hometown in the hometown property
            /// </summary>
            user_hometown,
            /// <summary>
            /// Provides access to the user's list of interests as the interests connection
            /// </summary>
            user_interests,
            /// <summary>
            /// Provides access to the list of all of the pages the user has liked as the likes connection
            /// </summary>
            user_likes,
            /// <summary>
            /// Provides access to the user's current location as the location property
            /// </summary>
            user_location,
            /// <summary>
            /// Provides access to the user's notes as the notes connection
            /// </summary>
            user_notes,
            /// <summary>
            /// Provides access to the user's online/offline presence
            /// </summary>
            user_online_presence,
            /// <summary>
            /// Provides access to the photos the user has been tagged in as the photos connection
            /// </summary>
            user_photo_video_tags,
            /// <summary>
            /// Provides access to the photos the user has uploaded
            /// </summary>
            user_photos,
            /// <summary>
            /// Provides access to the user's family and personal relationships and relationship status
            /// </summary>
            user_relationships,
            /// <summary>
            /// Provides access to the user's relationship preferences
            /// </summary>
            user_relationship_details,
            /// <summary>
            /// Provides access to the user's religious and political affiliations
            /// </summary>
            user_religion_politics,
            /// <summary>
            /// Provides access to the user's most recent status message
            /// </summary>
            user_status,
            /// <summary>
            /// Provides access to the videos the user has uploaded
            /// </summary>
            user_videos,
            /// <summary>
            /// Provides access to the user's web site URL
            /// </summary>
            user_website,
            /// <summary>
            /// Provides access to work history as the work property
            /// </summary>
            user_work_history,
            /// <summary>
            /// Provides access to the user's primary email address in the email property. Do not spam users. Your use of email must comply both with Facebook policies and with the CAN-SPAM Act.
            /// http://www.facebook.com/terms.php
            /// http://www.ftc.gov/bcp/edu/pubs/business/ecommerce/bus61.shtm
            /// </summary>
            email,
            /// <summary>
            /// Provides read access to any friend lists the user created. NOTE: All user's friends are provided as part of basic data, this extended permission grants access to the lists of friends a user has created, and should only be requested if your application utilizes lists of friends.
            /// </summary>
            read_friendlists,
            /// <summary>
            /// Provides read access to the Insights data for pages, applications, and domains the user owns.
            /// </summary>
            read_insights,
            /// <summary>
            /// Provides the ability to read from a user's Facebook Inbox. You must request to be whitelisted before you can prompt for this permission.
            /// http://www.facebook.com/help/contact.php?show_form=inbox_api_whitelist
            /// </summary>
            read_mailbox,
            /// <summary>
            /// Provides read access to the user's friend requests
            /// </summary>
            read_requests,
            /// <summary>
            /// Provides access to all the posts in the user's News Feed and enables your application to perform searches against the user's News Feed
            /// </summary>
            read_stream,
            /// <summary>
            /// Provides applications that integrate with Facebook Chat the ability to log in users.
            /// http://wiki.developers.facebook.com/index.php/Integrating_with_Facebook_Chat
            /// </summary>
            xmpp_login,
            /// <summary>
            /// Provides the ability to manage ads and call the Facebook Ads API on behalf of a user.
            /// http://wiki.developers.facebook.com/index.php/Ads_API_Getting_Started
            /// </summary>
            ads_management,
            /// <summary>
            /// Provides read access to the authorized user's check-ins or a friend's check-ins that the user can see.
            /// </summary>
            user_checkins,


            /// <summary>
            /// Provides access to the "About Me" section of the profile in the about property
            /// </summary>
            friends_about_me,
            /// <summary>
            /// Provides access to the user's list of activities as the activities connection
            /// </summary>
            friends_activities,
            /// <summary>
            /// Provides access to the birthday with year as the birthday_date property
            /// </summary>
            friends_birthday,
            /// <summary>
            /// Provides access to education history as the education property
            /// </summary>
            friends_education_history,
            /// <summary>
            /// Provides access to the list of events the user is attending as the events connection
            /// </summary>
            friends_events,
            /// <summary>
            /// Provides access to the list of groups the user is a member of as the groups connection
            /// </summary>
            friends_groups,
            /// <summary>
            /// Provides access to the user's hometown in the hometown property
            /// </summary>
            friends_hometown,
            /// <summary>
            /// Provides access to the user's list of interests as the interests connection
            /// </summary>
            friends_interests,
            /// <summary>
            /// Provides access to the list of all of the pages the user has liked as the likes connection
            /// </summary>
            friends_likes,
            /// <summary>
            /// Provides access to the user's current location as the location property
            /// </summary>
            friends_location,
            /// <summary>
            /// Provides access to the user's notes as the notes connection
            /// </summary>
            friends_notes,
            /// <summary>
            /// Provides access to the user's online/offline presence
            /// </summary>
            friends_online_presence,
            /// <summary>
            /// Provides access to the photos the user has been tagged in as the photos connection
            /// </summary>
            friends_photo_video_tags,
            /// <summary>
            /// Provides access to the photos the user has uploaded
            /// </summary>
            friends_photos,
            /// <summary>
            /// Provides access to the user's family and personal relationships and relationship status
            /// </summary>
            friends_relationships,
            /// <summary>
            /// Provides access to the user's relationship preferences
            /// </summary>
            friends_relationship_details,
            /// <summary>
            /// Provides access to the user's religious and political affiliations
            /// </summary>
            friends_religion_politics,
            /// <summary>
            /// Provides access to the user's most recent status message
            /// </summary>
            friends_status,
            /// <summary>
            /// Provides access to the videos the user has uploaded
            /// </summary>
            friends_videos,
            /// <summary>
            /// Provides access to the user's web site URL
            /// </summary>
            friends_website,
            /// <summary>
            /// Provides access to work history as the work property
            /// </summary>
            friends_work_history,
            /// <summary>
            /// Provides read access to the authorized user's check-ins or a friend's check-ins that the user can see.
            /// </summary>
            friends_checkins,

        }