For getting friends list of logged-in user, you can use requestForMyFriends method of FBRequest class.This method will give you dictionary of logged-in user friends on successful completion or execution.
Don’t worry about the code that does the same.Below is the code that shows how you can do it in IOS
FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
NSDictionary* result,
NSError *error) {
NSArray* friends = [result objectForKey:@”data”];
NSLog(@”Friends dictionary =%@”, result);
NSLog(@”Found: %i friends”, friends.count);
for (NSDictionary
NSLog(@”I have a friend named %@ with id %@”, friend.name, friend.id);
}
}];
In the above code, firstly we created an object of FBRequest class and calls our class method requestForMyFriends.Then we start our process with request completionHandler, and this handler will return us a list of friends on successful completion otherwise will show error,
NOTE:- Please add Facebook SDK for IOS to your project and other framework dependencies.
Attention:- With new version of Facebook SDk, you will only see list of friends who are using the same app, the one you are using to get friend list.