I want to make a FBFriendPickerViewController with all friends, I know there is other posts about it, but the answer is that I have tot put 'taggable_friends' instead of friends in request, but the result is the same with 'taggable_friends' as with 'friends'. The FBFriendPickerViewController contains only the friends who have instaled the app. Here is my code :
[FBSession openActiveSessionWithReadPermissions:
[NSArray arrayWithObjects:@"user_friends",nil] allowLoginUI:YES
completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
//YOUR CODE
FBRequest* friendsRequest = [FBRequest requestWithGraphPath:@"me/taggable_friends?fields=picture,name,username,location,first_name,last_name" parameters:nil HTTPMethod:@"GET"];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection, NSDictionary* result, NSError *error) {
//store result into facebookFriendsArray
facebookFriendsArray = [result objectForKey:@"data"];
[self.friendPickerController loadData];
}];
}];
if (self.friendPickerController == nil) {
// Create friend picker, and get data loaded into it.
self.friendPickerController = [[FBFriendPickerViewController alloc] init];
self.friendPickerController.title = @"Pick Friends";
self.friendPickerController.delegate = self;
}
[self.friendPickerController loadData];
[self.friendPickerController clearSelection];
[self presentViewController:self.friendPickerController animated:YES completion:nil];