I'm using the below code to get the friends list,
let fbRequest = FBSDKGraphRequest(graphPath:"/me/friends", parameters:["fields": "friendlists"]);
fbRequest.startWithCompletionHandler { (connection : FBSDKGraphRequestConnection!, result : AnyObject!, error : NSError!) -> Void in
if error == nil {
print("Friends are : \(result)")
} else {
print("Error Getting Friends \(error)");
}
}
It's always returning empty array.
OutPut:
Friends are : {
data = (
);
}
If I try sending a simple call to /me/friends, FBSDKGraphRequest(graphPath:"/me/friends", parameters:nil)
an error logged as below,
FBSDKLog: starting with Graph API v2.4, GET requests for //me/friends should contain an explicit "fields" parameter.
So I referred this answer for the above Parameters.
I authorized the app with two facebook users, both of them are friends in facebook, But I can't see their details in the response.
Still, empty array is returning.
Anyone please check whether the graph path and parameters I mentioned in the code is correct.
The privacy settings in the facebook account for friends list is public.