You want to use the real-time database functionality of Google Firebase. You have followed the guide page to complete all of them.
I also downloaded the Google-services file. The Firebase SDK installation is also complete.
I also created a database from the Firebase console.
My code is so simple because I was just testing it.
public class FirebaseManager : MonoBehaviour
{
DatabaseReference fbRef;
void Start(){
fbRef = FirebaseDatabase.DefaultInstance.RootReference;
}
}
what's wrong with FirebaseDatabase.DefaultInstance.RootReference;
??
I've redownloaded the google-service.json file and
added
"firebase_url" : "https://gamename-default-rtdb.firebaseio.com/"
this line to project_info
in google-services.json.
and I added these 2 lines to mainTemplate.gradle (Assets/Plugins/Android/mainTemplate.gradle)
implementation platform('com.google.firebase:firebase-bom:26.3.0')
implementation 'com.google.firebase:firebase-database-ktx'
but nothing changed.