- Home /
Question by
Manu_Kumar · Aug 19, 2016 at 09:38 AM ·
facebookjsonscoresdeserialize
Read JSON from Facebook?
Hello Guys :) I have a game in which I want to pull the scores from the facebook of the user which has logged in.
This is my code - >
public string Dialog;
public static int FBhighScore;
void Awake()
{
}
// Use this for initialization
void Start (){
if(FB.IsLoggedIn){
var PulledScore = new Dictionary<string,string>();
PulledScore["score"] = FBhighScore.ToString();
gameObject.GetComponent<Text>().text = Dialog+FBhighScore;
FB.API ("/me/scores",HttpMethod.GET, delegate(IGraphResult result) {
print ("Pulled Score Result : "+ result.RawResult);
}, PulledScore);
}
}
It gives the JSON data that comes from the facebook. This is it - >
{"data":[{"score":85,"user":{"name":"Mary Alabfabbdghgi Okelolawitz","id":"109442539486154"}}]}
I want to show the score of this person to a UI Text element.
How can I get it done?
Please help :)
Thanks Regards, Manu
Comment
Your answer
Follow this Question
Related Questions
How to use Scores API? 0 Answers
Problem deserialize Json api rest 1 Answer
Scores Api with Facebook sdk 7.3 and Unity 5.3 1 Answer
JSON invalid value 1 Answer
How to parse Json file in android? 3 Answers