How to get the Facebook friends from an user [Unity]

To get started with using Facebook in Gamedonia and initialize the Facebook plugin/SDK, visit our Facebook integration guide.

As with any other Facebook call, first we will need to have the user logged in Facebook. To do that, you can take a look at our Facebook login tutorial or our "Simple Login" Sample, where you can see a Facebook login button working. You can also follow the steps described in the Gamedonia Facebook guide.

Once the user is logged in, we need to call the RequestWithGraphPath method with the "/me/friends" type as done in this example of our Facebook guide:

void GetFriendsClick() {
    FacebookBinding.RequestWithGraphPath ("/me/friends",null,"GET",OnFriends);
}
...
private void OnFriends(IDictionary data) {
    Debug.Log ("I have: " + (data["data"] as IList).Count +  " Facebook friends");
}

More info here: Facebook integration guide