Replies: 1 comment
-
When you hot restart a Flutter app:
Recommended Solution (Safe & Practical) Note: you cannot keep the running Firebase instance during a hot restart in Flutter. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The app I'm working on uses Firestore from Flutter and native code (Android), and both use the same Firestore (db) instance. By hot restarting the app, it seems that in
didReinitializeFirebaseCore
the db instance gets terminated [link]. So the native code needs to stop using the terminated instance and get a new reference to the newly created instance for the native side to work correctly after hot restarting.Would it be possible to make the terminate-instance-on-hot-restart functionality optional, or are there some other ways the SDK is intended to be used in similar cases?
I haven't noticed any issues outside hot restarting, e.g. destroying the main activity and then returning back to the app (native side continued running and Flutter starts fresh), or on iOS.
Beta Was this translation helpful? Give feedback.
All reactions