I try to init Firebase depending on a user language preferences. For example:
User open an app. Select language A: Flutter should init project A (config, etc.). Similarly when the user selects a different language.
The problem is that iOS needs to have default GoogleService-Info.plist file. During the dynamic init of a Firebase there is created an app but the default one is from the default file and takes the priority over project A. Ultimately, two applications are created (DEFAULT and A). This causes that FirebaseMessaging is assigned to the default Firebase app instead of the second one based on a user preference.
According to the messaging.dart docs:
/// If [app] is not provided, the default Firebase app will be used.
// TODO: messaging does not yet support multiple Firebase Apps. Default app only.
In that case there is no possibility to support dynamic init of a Firebase config file due to the fact that there will be always a default app initiated from the default config file.
In native apps I can create many .plist files and invoke FirebaseApp.configure(options: options)
Do you have any idea how to solve this problem in Flutter?