[cloud_firestore]: Add to app support #13685
Labels
Needs Attention
This issue needs maintainer attention.
platform: ios
Issues / PRs which are specifically for iOS.
plugin: cloud_firestore
type: enhancement
New feature or request
Is there an existing issue for this?
Which plugins are affected?
Database
Which platforms are affected?
iOS
Description
I'm migrating an existing iOS app into flutter using add to app. The idea of add_to_app is that you can progressively migrate or provide certain features of the app with flutter.
For my app I'm trying migrate a screen that is not loaded during app initialization, so my flutter main() code is not executed on startup. This means that I perform certain queries with the native iOS Firestore SDK before I actually use flutter.
Now, when I start my flutter screen, I initialize firebase as usual, but when I try to make a query, I have an issue because the cloud firestore plugin tries to initialize firestore as well, this causes an issue because it tries to set the firestore settings after I have already performed queries with the native SDK
flutterfire/packages/cloud_firestore/cloud_firestore/ios/Classes/FLTFirebaseFirestorePlugin.m
Lines 227 to 253 in a4be697
I know it's not a common scenario, but I would expect the firestore database to support add_to_app. I'm not sure if there could be a way to somehow bypass this or you could implement a feature/fix.
Reproducing the issue
Steps to reproduce:
Expected result:
Flutter code should perform firestore query
Actual result:
Error is thrown, firestore settings should only be set on startup
it works fine if I remove this line
flutterfire/packages/cloud_firestore/cloud_firestore/ios/Classes/FLTFirebaseFirestorePlugin.m
Line 253 in a4be697
Firebase Core version
3.6.0
Flutter Version
3.24.2
Relevant Log Output
Flutter dependencies
Expand
Flutter dependencies
snippetAdditional context and comments
Thought this is a bug, maybe it doesn't really need to be fixed, I'm open to suggestions on how to bypass this issue, maybe we call on AppDelegate
i.e
though I'm not sure if FLTFirebaseFirestoreUtils is public
The text was updated successfully, but these errors were encountered: