public void GetHighscore(Action<DataSnapshot> callback) { highscoreRef.OrderByChild("total_score").LimitToLast(10).GetValueAsync().ContinueWith(task => { if (task.IsFaulted) { // Handle the error... Debug.Log(task.Exception.Message); } else if (task.IsCompleted) { callback(task.Result); } }); }Hi Johan,
Are there no possible cases other than error or isCompleted? Can you add an else to check?
I'm not a unity buff, but that seems like the first thing to rule out.
Kato
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/eb77e83a-80ff-4030-a9f6-434f09660152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Johan,
Are there no possible cases other than error or isCompleted? Can you add an else to check?
I'm not a unity buff, but that seems like the first thing to rule out.
Kato
On Nov 18, 2016 6:13 AM, "Johan Gustafsson" <johan....@gmail.com> wrote:
I'm using the new Unity-SDK to implement a highscore feature in a game.I am using the code below to fetch update the highscores but the first time I call it the ContinueWith does not fire. However, after the first call it starts working just fine. What am I doing wrong here?public void GetHighscore(Action<DataSnapshot> callback) {highscoreRef.OrderByChild("total_score").LimitToLast(10).GetValueAsync().ContinueWith(task => {if (task.IsFaulted) {// Handle the error...Debug.Log(task.Exception.Message);}else if (task.IsCompleted) {callback(task.Result);}});}
So the first time it never enters the lambda function inside ContinueWith.Best regards,
Johan
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/42d0f38d-b2e1-492a-9d31-88400916b9cd%40googlegroups.com.