VeriorPies / ParrelSync

(Unity3D) Test multiplayer without building
MIT License
4.67k stars 322 forks source link

[Solution] Crash when using Firebase #53

Closed keyserjaya closed 3 years ago

keyserjaya commented 3 years ago

Steps to reproduce:

  1. Import firebase
  2. Play original editor
  3. Play 1 clone editor
  4. Clone editor crashed

Fix: For Editor only, use: db = FirebaseFirestore.GetInstance(FirebaseApp.Create()); db.Settings.PersistenceEnabled = false; instead of db = FirebaseFirestore.DefaultInstance;

image

Reference: https://github.com/firebase/quickstart-unity/issues/638

somedeveloper00 commented 11 months ago

in the Firebase we were using, the syntax was

app = FirebaseApp.Create();
db = FirebaseDatabase.GetInstance(app);
db.SetPersistenceEnabled(true);

make sure to reuse the app for other FireBase modules like auth and storage. they all have some static GetInstance(app) syntax