System.Collections.Generic.Dictionary '2 error

I use Firebase cloud functions, and I get this data:

This is Firebase log:

{ ‘example’: ‘something’, name: ‘John’ }

So it’s work, but I want to handle the data received in Unity.

So unity C#:

.CallAsync(data).ContinueWith((task) =>
if (task.IsFaulted)
          // Handle the error...
else if (task.IsCompleted)
  print("result:" + task.Result.Data);

Unity log:


I want to handle the data.

I tried IDictionary, example: IDictionary snapshot = (IDictionary)task.Result.Data; and then print(snapshot["name"]) but nothing…


I am new to unity and programing in general so there might be better way to do this…

But for some reason methods cannot be run from CallAsync tasks only variables can be assigned. So you need to declare IDictionary snapshot at class level and do

else if (task.IsCompleted)
   snapshot = (IDictionary)task.Result.Data;

then you can use snapshot[“name”] in other methods.