Reputation: 23
I'm just testing if I could try to send data in my firebase database but I'm stuck at fixing this kind of error. "Failed to get to get FirebaseDatabase instance". I have no idea what's happening.
void TryDataSend(){
DatabaseReference root = FirebaseDatabase.DefaultInstance.RootReference;
}
Upvotes: 1
Views: 1234
Reputation: 1
The solution is simple. After creating database on firebase console download the updated configuration files and replace with old configuration files in unity project. Check the image for configuration file
Check the image for configuration file
Upvotes: 0
Reputation: 598765
To be able to connect to the Firebase database, the FirebaseDatabase
object needs to know the URL of that database. It typically will:
google-services.json
(Android)or GoogleService-Info.plist
(iOS) file upon startup as documented here,FirebaseDatabase.GetInstance
.The error message seems to indicate that neither of these things happened, so I recommend checking the links and see if you've taken all the steps.
Upvotes: 2