0

How can I fetch all informations about my friends with graph API ?

Here is my code :

LoginViewController.m (ViewController) :

- (IBAction)loginButtonTouchHandler:(id)sender
{
    // Set permissions required from the facebook user account
    NSArray *permissionsArray = @[@"public_profile", @"email", @"user_friends", @"user_birthday", @"friends_birthday"];

    // Login PFUser using facebook
    [PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {

        if (user) {
            [FBRequestConnection startForMeWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                if (!error) {
                    [self.navigationController popToRootViewControllerAnimated:YES];
                    // Store the current user's Facebook ID on the user
                    [[PFUser currentUser] setObject:[result objectForKey:@"email"]
                                             forKey:@"email"];
                    [[PFUser currentUser] setObject:[result objectForKey:@"name"]
                                             forKey:@"name"];
                    [[PFUser currentUser] saveInBackground];

                }
            }];
        }
    }];

}

CalendarViewController.m (UITableViewController) :

- (void)viewDidLoad
{
    [super viewDidLoad];
    [FBRequestConnection  startWithGraphPath:@"/me/friends"
                                      parameters:nil
                                      HTTPMethod:@"GET"
                               completionHandler:^(
                                                   FBRequestConnection *connection,
                                                   id result,
                                                   NSError *error
                                                   ) {
        if (!error) {
            // Success! Include your code to handle the results here
            NSLog(@"user info: %@", result);
        } else {
            NSLog(@"problem");
            // An error occurred, we need to handle the error
            // See: https://developers.facebook.com/docs/ios/errors
        }
    }];

Here is my NSLog :

"2014-08-08 22:55:16.615 Mindle[803:60b] user info: {
    data =     (
    );
    summary =     {
        "total_count" = 779;
    };
}"

That counts my friends, but is there any solution for fetching their birthday_date ?

Vjardel
  • 1,065
  • 1
  • 13
  • 28

1 Answers1

0

In API v2.0 or later you can not access your friends birthdays.

WizKid
  • 4,888
  • 2
  • 23
  • 23