Question by
john-essy · Nov 03, 2016 at 09:27 PM ·
serializationfacebookleaderboards
Facebook Desiralize
Hey there,
I am busy trying to deserialise my objects i get back from facebook, but they keep returning a null reference.
This is the first time i have had to deal with objects, dictionaries, and deserializing so its a bit overwhelming. Any help or pointers top understand better would be greatly appreciated.
here is my code
private void ScoresCallBack(IGraphResult result)
{
var scoreList = Json.Deserialize(result.ResultList.ToString()) as List<object>;
Debug.Log(scoreList);
if (scoreList == null)
{
Debug.Log("Scores are null");
return;
}
foreach (var score in scoreList)
{
var entry = (Dictionary<string, object>) score;
var user = (Dictionary<string, object>) entry["user"];
GameObject ScorePanel;
ScorePanel = Instantiate(scoreEntryPanel) as GameObject;
ScorePanel.transform.parent = scoreScrollList.transform;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612100008im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Google Play and Facebook leaderboards 0 Answers
Getting Player Picture with bad request in unity 5 1 Answer
Facebook.MiniJSON Deserialize comments and nested values under from returning no values. 1 Answer
IAP gives ERROR_BROKEN_PIPE 3 Answers
firebase - Facebook authentication invalid access_token error code 43 1 Answer