- Home /
Question by
unity_0503E81A15D3B375AE82 · Jan 18 at 11:27 AM ·
facebook
Issue with Facebook SDK 7.8.0 for fetching list of friends
i keep getting this error KeyNotFoundException: The given key was not present in the dictionary. for "name"
I am following this tutorial: https://www.youtube.com/watch?v=so0TcptiLeM
public void GetFriendsPlayingThisGame() { string query = "/me/friends"; FB.API(query, HttpMethod.GET, result => { var dictionary = (Dictionary )Facebook.MiniJSON.Json.Deserialize(result.RawResult);
var friendsList = (List<object>)dictionary["data"];
FriendsText.text = string.Empty;
foreach (Dictionary<string, object> dict in friendsList)
{
//Debug.Log(dict.ContainsKey " " + dict.ContainsValue);
GameObject go = Instantiate(FriendTextPrefab);
go.GetComponent<Text>().text = dict["name"].ToString();
FriendsText.text += dict["name"];
}
});
}
Comment