- Home /
Can't load(get) data from Firebase (an error occurs)
Hi, I am using the database "firebase" in my unity project, to save data and load it from the database. I can save my data (its working), but my problem is: I can't load data. Everytime when I call the function to call the data, this error appears: "The hostname of this url (https://game-name.firebaseio.com/) is different from the database url (https://game-name.firebaseio.com/) UnityEngine.Debug:LogError(Object)"
This is the piece of code where the error occurs: public string GetSomeData() { string jsonData = ""; DataSnapshot dataSnap = null; string url = "https://game-name.firebaseio.com/"; // AT THIS LINE OCCURS THE ERROR ↓ FirebaseDatabase.DefaultInstance.GetReferenceFromUrl(url).GetValueAsync().ContinueWith(task => { if (task.IsCanceled) { Debug.Log("Canceled"); } else if (task.IsFaulted) { Debug.Log("Faulted"); } else if (task.IsCompleted) { Debug.Log("Completed"); dataSnap = task.Result; jsonData = dataSnap.GetRawJsonValue(); } }); return child.GetRawJsonValue(); }
Can someone help me please?
Versions:
Unity: 2019.2.0f1
Firebase: 6.16.1
Your answer
Follow this Question
Related Questions
save load exp on database 2 Answers
Xml Saving and Loading Problems 1 Answer
Saving/storing in a clash of clans type game 0 Answers
Unity Serializer scripting error 1 Answer
Serialization scripting error 1 Answer