I am using below code to get Facebook friend that uses app
// Issue a Facebook Graph API request to get your user's friend list
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{friendlist-id}"
parameters:nil
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
But I am getting following response.
{
data = (
);
summary = {
"total_count" = 279;
};
}
How can I get fbID like we use to get in last api version using FBRequest.
Note I am using latest FB SDK.
Thanks.
Its not possible to get FriendList or EmailId of Friends, according to new API version, but if You want show FriendList use TaggableFriend Feature of Facebook.This Taggable API needs Approval from Facebook and this API returns id, Friend name, Profile picture URL.but Id is not FacebookId its Id for Post on wall.This only way to get friends.But if you use me/friends it return total number of friends and friend List of app User. Since you you don't have app user it only showing total Count of Friend.To implement this Feature you login with Admin Account(The Account from which Facebook ID Created)for this you have to implement the paging Concept.
Use this Code Spinnet: "/me/taggable_friends?fields=id,name,picture.type(large).
You have to add permission at login time user_friends
A user access token with user_friends
permission is required to view any of that person's friend lists.
you can get only that friends who installed the same apps,
Only friends who installed this app are returned in API v2.0 and higher. total_count in summary represents the total number of friends, including those who haven't installed the app.
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"me/friends"
parameters:nil
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With