Reputation: 9461
I am trying to fetch facebook friend of logged user in my iphone app. i use Facebook sdk v2.2. facebook code return only one friend detail.but in the my facebook acccount 11 friends. i used xcode 5.1 and my development target 7.1
here is my code.
[FBRequestConnection startWithGraphPath:@"/me/friends"
parameters:nil
HTTPMethod:@"GET"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
) {
/* handle the result */
NSLog(@"friend list = %@",result);
NSArray* friends = [result objectForKey:@"data"];
NSLog(@"friends = %@",friends);
}];
Please suggest to me where am i wrong. Thank you for give your precious time for suggestion.
Upvotes: 1
Views: 166
Reputation: 22903
You are experiencing the correct behaviour. From the v2 of the Graph API, you can only get the list of friends who authorized your app already. In your case, it looks like only one of your friends used your app.
API Reference
/{user-id}/friends
This will only return any friends who have used (via Facebook Login) the app making the request.
Source: https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends
Upvotes: 4