mashios
mashios

Reputation: 70

Facebook friend list

I am working on application where I want to access user friends list by login into facebook application. I am using xcode 4.2 ios 5 framework. I have gone through many tutorial but didn't find proper solution. please help me out.

Upvotes: 0

Views: 739

Answers (2)

DeviPhone26
DeviPhone26

Reputation: 615

- (void)getFriendsResponse {
    FbGraphResponse *fb_graph_response = [fbGraph doGraphGet:@"me/friends" withGetVars:nil];// me/feed 
//parse our json
   SBJSON *parser = [[SBJSON alloc] init];
   NSDictionary *   facebook_response = [parser objectWithString:fb_graph_response.htmlResponse error:nil]; 
   //init array 
        NSMutableArray * feed = (NSMutableArray *) [facebook_response objectForKey:@"data"];
        NSMutableArray *recentFriends = [[NSMutableArray alloc] init];

        //adding values to array
        for (NSDictionary *d in feed) {

            NSLog(@"see Dicitonary :%@",d );
            facebook   = [[Facebook alloc]initWithFacebookDictionary:d ];
            [recentFriends addObject:facebook];
            NSLog(@"Postsss :->>>%@",[facebook sender]);

            [facebook release];
        }

        friends = recentFriends;

        [self.tableView reloadData];
     }

Upvotes: 1

Hiren
Hiren

Reputation: 12780

use facebook graph api. To get a list of their friend lists, you need read_friendlists extended permission. Graph Api reference and permissions

Upvotes: 0

Related Questions