0

i want to get all friend list of facebook friend but didn't getting list.

if (!FBSession.activeSession.isOpen) {
    // if the session is closed, then we open it here, and establish a handler for state changes
    [FBSession openActiveSessionWithReadPermissions:@[@"public_profile", @"user_friends"] allowLoginUI:YES completionHandler:^(FBSession *session,FBSessionState state,NSError *error) {
        if (error)
        {
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
            message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alertView show];
        }
        else if (session.isOpen)
        {
            [self pickFriendsButtonClick:sender];
        }
    }];
    return;
}

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];

i use this code to get all FB friends but it not work for me.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
nizama bunti
  • 367
  • 1
  • 4
  • 18

1 Answers1

1

You can only get the friends who are also using your App now, see this thread for more information: empty friends array in facebook open graph api v2

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130