Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

iterate though data in firebase unity

public void GetUsers(List<User> users)
{
        FirebaseDatabase.DefaultInstance
  .GetReference("users")
        .GetValueAsync().ContinueWith(task =>
         {
                 if (task.IsFaulted) {
      // Handle the error...
                    Debug.Log("Error was:"+task.Exception.Message);
                    Debug.LogError("Error was:"+task.Result.Children);
            }
            else if (task.IsCompleted) {
            DataSnapshot snapshot = task.Result;
            // Do something with snapshot...
                        foreach(DataSnapshot s in snapshot.Children){
                        IDictionary dictUsers = (IDictionary)s.Value;   
                        Debug.Log(dictUsers["displayName"]);                    
                    }   
                    // After this foreach loop in snapshot.Children, nothing executes
                    UIManager.instance.ShowOtherUsers();
            }
  });
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: tostring format 2 decimals 
Csharp :: ihttpactionresult to object c# 
Csharp :: reverse linked list 
Csharp :: C# domain name to ip address 
Csharp :: c# delete files 
Csharp :: list sort c# 
Csharp :: window height in C# forms 
Csharp :: c# list find index 
Csharp :: quaternion rotation unity 
Csharp :: c# get all letters 
Csharp :: List C# add from List 
Csharp :: visitor pattern 
Csharp :: animation setbool unity 
Csharp :: c# for 
Csharp :: C# linq mselect 
Csharp :: preprocessors in c# 
Csharp :: c# generic return type in interface 
Csharp :: .net core change localhost port 
Csharp :: unity c# find object position in array 
Csharp :: aspx receive variable from url 
Csharp :: itext7 pdfwriter outputstream c# 
Csharp :: regular expression alphanumeric dash space c# 
Csharp :: unity rigidbody freeze rotation y z 
Csharp :: binding on button c# 
Csharp :: asp net c# browser cursor wait 
Csharp :: set request size c# 
Csharp :: minimum of three numbers 
Csharp :: Get location in Xamarin - NAYCode.com 
Csharp :: system.drawing.color to system.consolecolor 
Csharp :: use c#9 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =