Facebook friend list import became easier after using latest Facebook SDK. Here is the method which imports friend list.
NSMutableArray *arrfriendList = [[NSMutableArray alloc]init];
[FBRequestConnection startForMyFriendsWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error){
if (!error){
// These are the current permissions the user has
NSLog(@"Friends ===>> %@", result);
arrfriendList =[result valueForKey:@"data"];
} else {
// An error occurred, we need to handle the error
// Check out our error handling guide:
NSLog(@"%@",[NSString stringWithFormat:@"error %@", error.description]);
}
}];
For more help see the attached sample code.
Happy Coding ...!!!
0 Comment(s)