S
S
standOnMyGround2014-05-28 21:54:10
Facebook
standOnMyGround, 2014-05-28 21:54:10

How to get facebook friends list for ios app?

Good afternoon.
When trying to display a list of friends, the console returns an empty value. I can't figure out where the error is.
I thank you in advance.

if (!FBSession.activeSession.isOpen) {
   [FBSession openActiveSessionWithReadPermissions:@[@"email",@"user_friends"]
                                            allowLoginUI:YES
                                           completionHandler:^(FBSession *session,
                                            FBSessionState state,
                                            NSError *error) {
           if (error) {
                           UIAlertView *alertView = [[UIAlertView alloc] itWithTitle:@"Error"
                                                  message:error.localizedDescription
                                                   delegate:nil
                                                    cancelButtonTitle:@"OK"
                                                     otherButtonTitles:nil];
                                              [alertView show];
                                          } else if (session.isOpen) {
                                              NSLog(@"OPEN");           
                                   
                            [FBRequestConnection startWithGraphPath:@"/me/friends"
                                    parameters:nil
                                    HTTPMethod:@"GET"
                                     completionHandler:^(
                                      FBRequestConnection *connection,
                                                                     id result,
                                                           NSError *error
                                                      ) {
                                                        NSLog(@"RESULT %@",result);
                                                     }];
                                               }
                                               
                                }];
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question