I am trying to get data from Firebase's Realtime database. In my database, I have a node named users. Under that, I have the UUID of All users. I want to get all UUIDs. I tried with unity Restclient API. And the result was an empty thing.
my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Models;
using Proyecto26;
using UnityEngine.Networking;
public class AdminPanel : MonoBehaviour
{
public GameObject manager;
public string idToken,localId;
public string databaseURL = "https://xxx.firebaseio.com/";
private void LogMessage(string title, string message) {
#if UNITY_EDITOR
EditorUtility.DisplayDialog (title, message, "Ok");
#else
Debug.Log(message);
#endif
}
void Start()
{
idToken = manager.GetComponent<SignUpData>()._idToken;
localId = manager.GetComponent<SignUpData>()._localId;
}
public void GetData()
{
RestClient.GetArray<users>(databaseURL + "users" +".json?auth=" + idToken).Then(res => {
this.LogMessage("Users", JsonHelper.ArrayToJsonString<users>(res, true));
}).Catch(err => this.LogMessage("Error", err.Message));
}
}