Closed alirezat66 closed 1 year ago
@alirezat66 Thanks for the report. If I understand correctly, you have multiple firebase options based on your environment, just like having flavors, is it correct ?
If so, using firebase_options
doesn't support flavors or multiple environments. See this issue for your reference: https://github.com/invertase/flutterfire_cli/issues/14
Hii dear Darshankawar, the problem is that I don't want different environment based on building time, cause we have 3 different market that user can choose between them based on run time and I want to change the firebase option in run time.
On Wed, May 3, 2023 at 2:43β―PM darshankawar @.***> wrote:
@alirezat66 https://github.com/alirezat66 Thanks for the report. If I understand correctly, you have multiple firebase options based on your environment, just like having flavors, is it correct ?
If so, using firebase_options doesn't support flavors or multiple environments. See this issue for your reference: invertase/flutterfire_cli#14 https://github.com/invertase/flutterfire_cli/issues/14
β Reply to this email directly, view it on GitHub https://github.com/firebase/flutterfire/issues/10898#issuecomment-1532966443, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABU4WOPJR4AETYXQXWZJL7LXEJHH7ANCNFSM6AAAAAAXUIM3KE . You are receiving this because you were mentioned.Message ID: @.***>
-- Kind regards, Reza Taghizadeh
Thanks for the feedback @alirezat66
I want to change the firebase option in run time.
I am not sure if this is possible currently using firebase_options
. Also, since firebase_options
is coming from cli command flutterfire configure
which generates the said file, I suggest you to raise this issue in dedicated repo for further resolution and closing it from here. If you disagree, write in comments and I'll reopen it.
Bug report
Describe the bug I try to change the name and the options run time, cause we have diffrent firebase based on our market. so I develop bellow code:
and run it in my ServiceLocator. each time that user change the market I call this code again and initializeApp again. when I check the debugView in firebase I see that it still sends data for first run initilized app not for new one.
Steps to reproduce
Steps to reproduce the behavior:
firebaseApp = await Firebase.initializeApp( name: firebaseOption.projectId, options: firebaseOption, );
and change it for example with a button again. you can see always firebase send the new events to the oldoneExpected behavior
It should work fine and send the data for new firebase after we change the firebase
Additional context
nothing thanks.
Flutter doctor
Run
flutter doctor
and paste the output below:Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` Dart SDK 2.19.5 Flutter SDK 3.7.8 moebel_de 0.0.0+0 dependencies: - algolia 1.1.2 [meta http uuid universal_io] - appsflyer_sdk 6.9.3 [flutter] - bloc_test 9.1.1 [bloc diff_match_patch meta mocktail test] - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - carousel_slider 4.2.1 [flutter] - cider 0.1.5 [args change klizma markdown path pub_semver version_manipulation yaml rfc_6901 pubspec_parse] - connectivity_plus 3.0.6 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - contentful_rich_text 2.0.0 [flutter collection html_unescape url_launcher] - convenient_test 1.2.1 [collection flutter] - equatable 2.0.5 [collection meta] - firebase_analytics 10.2.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_core 2.10.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.1.2 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_dynamic_links 5.1.1 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_messaging 14.4.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_bloc 8.1.2 [flutter bloc provider] - flutter_custom_tabs 1.0.4 [flutter flutter_custom_tabs_platform_interface flutter_custom_tabs_web meta] - flutter_dotenv 5.0.2 [flutter] - flutter_local_notifications 12.0.4 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] - flutter_mobile_carousel 1.1.0 [flutter] - flutter_phoenix 1.1.1 [flutter] - flutter_svg 2.0.5 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - gap 2.0.2 [flutter] - get_it 7.3.0 [async collection] - go_router 6.5.9 [collection flutter flutter_web_plugins logging meta] - google_fonts 4.0.4 [flutter http path_provider crypto] - http 0.13.6 [async http_parser meta] - intl 0.17.0 [clock path] - isar 3.1.0+1 [ffi js meta] - isar_flutter_libs 3.1.0+1 [flutter isar] - launch_review 3.0.1 [flutter] - meta 1.8.0 - package_info_plus 1.4.3+1 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web] - path 1.8.2 - path_provider 2.0.14 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - rating_dialog 2.0.4 [flutter flutter_rating_bar] - retry 3.1.1 - rxdart 0.27.7 - shared_preferences 2.1.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - sqflite 2.2.8 [flutter sqflite_common path] - url_launcher 6.1.10 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - usage 4.1.1 [meta path] - usercentrics_sdk 2.7.10 [flutter] - uuid 3.0.7 [crypto] dev dependencies: - build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - dart_code_metrics 5.7.2 [analyzer analyzer_plugin ansicolor args collection crypto dart_code_metrics_presets file glob html http meta path platform pub_updater source_span uuid xml yaml] - envied 0.3.0 - envied_generator 0.3.0 [envied build source_gen analyzer] - flutter_launcher_icons 0.12.0 [args checked_yaml cli_util image json_annotation path yaml] - flutter_lints 2.0.1 [lints] - flutter_native_splash 2.2.19 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml] - flutter_oss_licenses 2.0.1 [path meta yaml dart_pubspec_licenses args] - isar_generator 3.1.0+1 [analyzer build dart_style dartx glob isar path source_gen xxh3] - mockito 5.4.0 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api] - patrol 0.7.6 [fixnum flutter flutter_driver flutter_test grpc http integration_test json_annotation meta path protobuf vm_service] - rps 0.7.0-dev.6 [yaml path ffi] transitive dependencies: - _fe_analyzer_shared 58.0.0 [meta] - _flutterfire_internals 1.1.1 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.10.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - analyzer_plugin 0.11.2 [analyzer collection dart_style pub_semver yaml] - ansicolor 2.0.1 - archive 3.3.2 [crypto path] - args 2.4.0 - async 2.10.0 [collection meta] - bloc 8.1.1 [meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.3.1 [analyzer async convert crypto glob logging meta path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.1.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.2.0 [analyzer async build collection crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.4.4 [built_collection collection fixnum meta] - cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface] - change 0.6.0 [markdown marker pub_semver intl] - characters 1.2.1 - checked_yaml 2.0.2 [json_annotation source_span yaml] - cli_util 0.3.5 [meta path] - clock 1.1.1 - code_builder 4.4.0 [built_collection built_value collection matcher meta] - collection 1.17.0 - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service] - crypto 3.0.2 [typed_data] - csslib 0.17.2 [source_span] - dart_code_metrics_presets 1.6.0 - dart_pubspec_licenses 2.0.2 [yaml path json_annotation] - dart_style 2.3.0 [analyzer args path pub_semver source_span] - dartx 1.1.0 [characters collection crypto meta path time] - dbus 0.7.8 [args ffi meta xml] - diff_match_patch 0.4.1 - fake_async 1.3.1 [clock collection] - ffi 2.0.1 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.4.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.2+1 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_core_platform_interface 4.6.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.3.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.4.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.4+1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.3.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.3.1 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - fixnum 1.1.0 - flutter_blurhash 0.7.0 [flutter] - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_custom_tabs_platform_interface 1.0.1 [flutter plugin_platform_interface meta] - flutter_custom_tabs_web 1.0.0 [flutter flutter_web_plugins flutter_custom_tabs_platform_interface meta url_launcher_web url_launcher_platform_interface] - flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver archive async boolean_selector characters clock collection crypto js matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math] - flutter_local_notifications_linux 2.0.0 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories] - flutter_local_notifications_platform_interface 6.0.0 [flutter plugin_platform_interface] - flutter_rating_bar 4.0.1 [flutter] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 3.2.0 [async path] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - glob 2.1.1 [async collection file path string_scanner] - googleapis_auth 1.4.0 [args crypto http http_parser js] - graphs 2.2.0 [collection] - grpc 3.1.0 [archive async crypto fixnum googleapis_auth meta http http2 protobuf] - html 0.15.2 [csslib source_span] - html_unescape 2.0.0 - http2 2.0.1 - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.0.16 [archive meta xml] - integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service archive async boolean_selector characters clock collection crypto fake_async file js matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math webdriver] - io 1.0.4 [meta path string_scanner] - js 0.6.5 [meta] - json_annotation 4.8.0 [meta] - klizma 0.2.1 - lints 2.0.1 - logging 1.1.1 - markdown 7.0.2 [args meta] - marker 0.5.1 [markdown] - matcher 0.12.13 [meta stack_trace] - material_color_utilities 0.2.0 - mime 1.0.4 - mocktail 0.3.0 [collection matcher test] - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - node_preamble 2.0.2 - octo_image 1.0.2 [flutter flutter_blurhash] - package_config 2.1.0 [path] - package_info_plus_linux 1.0.5 [package_info_plus_platform_interface flutter path] - package_info_plus_macos 1.3.0 [flutter] - package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface] - package_info_plus_web 1.0.6 [flutter flutter_web_plugins http meta package_info_plus_platform_interface] - package_info_plus_windows 2.1.0 [package_info_plus_platform_interface ffi flutter win32] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.0.27 [flutter path_provider_platform_interface] - path_provider_foundation 2.2.2 [flutter path_provider_platform_interface] - path_provider_linux 2.1.10 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.0.6 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.6 [ffi flutter path path_provider_platform_interface win32] - pedantic 1.11.1 - permission_handler_android 10.2.0 [flutter permission_handler_platform_interface] - permission_handler_apple 9.0.8 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.9.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.2 [flutter permission_handler_platform_interface] - petitparser 5.1.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.4 [meta] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - protobuf 2.1.0 [fixnum collection meta] - provider 6.0.5 [collection flutter nested] - pub_semver 2.1.3 [collection meta] - pub_updater 0.2.4 [http json_annotation process] - pubspec_parse 1.2.2 [checked_yaml collection json_annotation pub_semver yaml] - rfc_6901 0.1.1 - shared_preferences_android 2.1.4 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.2.1 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.2.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.2.0 [flutter plugin_platform_interface] - shared_preferences_web 2.1.0 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.2.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.0 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 3.0.1 [path shelf shelf_static] - shelf_static 1.1.1 [convert http_parser mime path shelf] - shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.2.7 [analyzer async build dart_style glob path source_span yaml] - source_map_stack_trace 2.1.1 [path source_maps stack_trace] - source_maps 0.10.12 [source_span] - source_span 1.9.1 [collection path term_glyph] - sqflite_common 2.4.5 [synchronized path meta] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - sync_http 0.3.1 - synchronized 3.1.0 - term_glyph 1.2.1 - test 1.22.0 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core] - test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.4.20 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - time 2.1.3 [clock] - timezone 0.9.2 [path] - timing 1.0.1 [json_annotation] - typed_data 1.3.1 [collection] - universal_io 2.2.0 [collection meta typed_data] - url_launcher_android 6.0.31 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.4 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.5 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.5 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.2 [flutter plugin_platform_interface] - url_launcher_web 2.0.16 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.6 [flutter url_launcher_platform_interface] - vector_graphics 1.1.5 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.5 - vector_graphics_compiler 1.1.5 [args meta path_parsing xml vector_graphics_codec] - vector_math 2.1.4 - version_manipulation 0.1.1 [pub_semver] - vm_service 9.4.0 - watcher 1.0.2 [async path] - web_socket_channel 2.4.0 [async crypto stream_channel] - webdriver 3.0.1 [archive matcher path stack_trace sync_http] - webkit_inspection_protocol 1.2.0 [logging] - win32 3.1.4 [ffi] - xdg_directories 0.2.0+3 [meta path process] - xml 6.2.2 [collection meta petitparser] - xxh3 1.0.1 ```