don't repeat firebase reference android code example
Example: iterate though data in firebase unity
public void GetUsers(List<User> users)
{
FirebaseDatabase.DefaultInstance
.GetReference("users")
.GetValueAsync().ContinueWith(task =>
{
if (task.IsFaulted) {
Debug.Log("Error was:"+task.Exception.Message);
Debug.LogError("Error was:"+task.Result.Children);
}
else if (task.IsCompleted) {
DataSnapshot snapshot = task.Result;
foreach(DataSnapshot s in snapshot.Children){
IDictionary dictUsers = (IDictionary)s.Value;
Debug.Log(dictUsers["displayName"]);
}
UIManager.instance.ShowOtherUsers();
}
});
}