You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a couple of Firebase services that need to be started up only after user signs in. I'm using custom sign in provider.
For me this means
Initializing Firebase with await Firebase.initializeApp() when my application starts.
Wait for user to sign-in.
After succesful sign-in I create FirebaseAuth instance by doing _auth = FirebaseAuth.instance
I do the same for FirebaseFirestore with _store = FirebaseFirestore.instance
I'm trying to hunt down a bug where if I open my application after some time, I'm not receiving any updates from FirebaseFirestore even when I log out and log in1 with my user. I'm thinking maybe my authentication is set up wrong and that is why I'm asking here.
After logging out I do this in my classes that manage Firebase services (example):
This means when I'm logging in again, I'm also calling FirebaseAuth.instance and FirebaseFirestore.instance too. Could this be cause for concern?
I assume not since it's a static field on a class and it probably returns a singleton. However I wanted to double check this before I start doing any changes.
Footnotes
When looking at my logs, I don't see any errors thrown by the library ↩
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a couple of Firebase services that need to be started up only after user signs in. I'm using custom sign in provider.
For me this means
await Firebase.initializeApp()
when my application starts.FirebaseAuth
instance by doing_auth = FirebaseAuth.instance
FirebaseFirestore
with_store = FirebaseFirestore.instance
I'm trying to hunt down a bug where if I open my application after some time, I'm not receiving any updates from
FirebaseFirestore
even when I log out and log in1 with my user. I'm thinking maybe my authentication is set up wrong and that is why I'm asking here.After logging out I do this in my classes that manage Firebase services (example):
This means when I'm logging in again, I'm also calling
FirebaseAuth.instance
andFirebaseFirestore.instance
too. Could this be cause for concern?I assume not since it's a static field on a class and it probably returns a singleton. However I wanted to double check this before I start doing any changes.
Footnotes
When looking at my logs, I don't see any errors thrown by the library ↩
Beta Was this translation helpful? Give feedback.
All reactions