I want a list of other Facebook friends that have logged into my app, but the code below is not working. I know I have other friends on the app but all it prints is "data(); totalCount(796);" Why is data always empty?
let params = ["fields": "id, first_name, last_name, middle_name, name, email, picture"]
let request = FBSDKGraphRequest(graphPath: "me/friends", parameters: params)
request!.start { (connection, result, error) -> Void in
if error != nil {
print(error!)
}
else if result != nil{
print(result!)
}
}
You haven't given much code, but it looks like you are forgetting to cast your data array after you've retrieved the information. It's kind of hard to tell without looking at your other code, but you might find this answer useful.
Here is an example of proper data casting and retrieval.