1

I try to login user to my app with the following permissions:

NSArray* permissions = [[NSArray alloc] initWithObjects:@"email", @"read_friendlists", @"user_friends", nil];

After login I don't get "read_friendlists" permission from

[FBRequestConnection startWithGraphPath:@"/me/permissions"....];

request.

I think this is the reason, why I can't get the full friend list.

I tried to get the list with the following methods:

[FBRequestConnection startWithGraphPath:@"me/friends"
                                 parameters:nil
                                 HTTPMethod:@"GET"
                          completionHandler:^(
                                              FBRequestConnection *connection,
                                              id result,
                                              NSError *error
                                              ) {
                              NSLog(@"FriendList: %@", result);
                              /* handle the result */
                          }];

AND

FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
                                              NSDictionary* result,
                                              NSError *error) {
    NSArray* friends = [result objectForKey:@"data"];
    NSLog(@"Found: %i friends", friends.count);
    for (NSDictionary<FBGraphUser>* friendIns in friends) {
        NSLog(@"I have a friend named %@ with id %@", friendIns.name, friendIns.id);
    }
}];

These methods give me the friends, who also use my app, and not the whole friend list. What's wrong with my method(s)? How to get the full friend list from user?

andras
  • 11
  • 1

1 Answers1

2

read_friendlists is not for getting friends, but only for getting the lists you created (without any friends in it). It also needs approval from Facebook before you can use it, but it´s definitely not what you want.

user_friends is for getting access to the friends who authorized your App too, with /me/friends. That would be the appropriate way.

There is no way to get ALL friends anymore, unless you want to tag friends (taggable_friends) or invite friends to a game on Facebook Canvas (invitable_friends).

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Is there any other way to get the list? For example direct api call, and handle the callback – andras Dec 15 '14 at 22:03
  • nope. there is no other way. we are not supposed to get access to people who did not authorize the app anymore, for privacy reasons. – andyrandy Dec 15 '14 at 22:05