Ravi
Ravi

Reputation: 95

Access friend list from facebook in unity

i'm using "facebook unity plugin".I'm using this code to access the friend list .

FB.Login("read_friendlists", LoginCallback);
void LoginCallback() {
    enabled = true;
    FB.API (
        "/me/FRIENDLIST_ID",
        Facebook.HttpMethod.GET,
        APICallback
    );
}
Dictionary<string, object> resp = MiniJSON.Json.Deserialize(response) as Dictionary<string, object>;
        foreach(string k in resp.Keys){
            Strings += k+" ";
        }

i'm able to get the permission for accessing the friend list, but don't know how i use this to get friend list, using (/FRIENDLIST_ID) in request but my app is crashing and if i have to access the friend list for a particular game what code i should write.

Upvotes: 0

Views: 11706

Answers (1)

Try to use FB.API("/me/friends?fields=id,name", …) and find friend by id in response.

Upvotes: 3

Related Questions