Closed ted-marozzi closed 2 years ago
Checked on latest master wherein, I don't get the said log, but getting the same on latest stable:
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
FirebaseAnalytics.instance.setDefaultEventParameters({"version":"1.0.0"});
await Firebase.initializeApp(
Checked on latest master wherein, I don't get the said log, but getting the same on latest stable:
Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); FirebaseAnalytics.instance.setDefaultEventParameters({"version":"1.0.0"}); await Firebase.initializeApp(
console error log stable flutter doctor -v
It happens on web - but this is intended since this method is not supported on web - we're sorting a PR to make the error message more explicitly say it's not supported on web - but for this issue I'd say it's working as intended
Would be good to suggest that in the docs: https://firebase.flutter.dev/docs/analytics/usage#default-parameters
Can I ask why is it not supported? Is there a fundamental reason or is it just yet to be implemented?
Thanks for your time.
@ted-marozzi It's not supported by the underlying web firebase-js -sdk. Will update documentation as you suggested.
For anyone that arrives here wanting this feature, I opened an issue on the firebase-js-sdk which you can thumbs up.
Bug report
Describe the bug The error
is thrown when called on web
Steps to reproduce
Steps to reproduce the behavior:
FirebaseAnalytics.instance.setDefaultEventParameters({"version":"1.0.0"});
Expected behavior
Error is not thrown in console.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
PS C:\GitHub\stockpile> flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.22000.318], locale en-AU) [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [√] Chrome - develop for the web [√] Android Studio (version 2020.3) [√] VS Code (version 1.62.3) [√] Connected device (2 available) • No issues found!Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
PS C:\GitHub\stockpile> flutter pub deps -- --style=compact Dart SDK 2.14.4 Flutter SDK 2.5.3 stockpile 1.0.15 dependencies: - firebase_analytics 9.0.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_core 1.10.3 [firebase_core_platform_interface firebase_core_web flutter meta] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math] - google_fonts 2.1.0 [flutter http path_provider crypto] - logging 1.0.2 - package_info_plus 1.3.0 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web] dev dependencies: - cider 0.1.0 [args change klizma intl markdown marker path pub_semver version_manipulation yaml rfc_6901 pubspec_parse] - flutter_launcher_icons 0.9.2 [args image path yaml] - flutter_lints 1.0.4 [lints] - flutter_native_splash 1.3.2 [args image meta path xml yaml universal_io] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] - integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service archive async boolean_selector characters charcode clock collection crypto fake_async file matcher meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math webdriver] transitive dependencies: - archive 3.1.2 [crypto path] - args 2.3.0 - async 2.8.1 [collection meta] - boolean_selector 2.1.0 [source_span string_scanner] - change 0.3.0 [markdown marker pub_semver intl] - characters 1.1.0 - charcode 1.3.1 - checked_yaml 2.0.1 [json_annotation source_span yaml] - clock 1.1.0 - collection 1.15.0 - crypto 3.0.1 [collection typed_data] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase_analytics_platform_interface 3.0.0 [firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.4.0 [firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_core_platform_interface 4.2.0 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.5.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver archive async boolean_selector characters charcode clock collection crypto matcher platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - http 0.13.4 [async http_parser meta path] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.1.0 [archive meta xml] - intl 0.17.0 [clock path] - js 0.6.3 - json_annotation 4.4.0 [meta] - klizma 0.2.0 - lints 1.0.1 - markdown 4.0.1 [args charcode meta] - marker 0.2.2 [markdown] - matcher 0.12.10 [stack_trace] - meta 1.7.0 - package_info_plus_linux 1.0.3 [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.4 [flutter flutter_web_plugins http meta package_info_plus_platform_interface] - package_info_plus_windows 1.0.4 [package_info_plus_platform_interface ffi flutter win32] - path 1.8.0 - path_provider 2.0.7 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - path_provider_android 2.0.9 [flutter path_provider_platform_interface] - path_provider_ios 2.0.7 [flutter path_provider_platform_interface] - path_provider_linux 2.1.2 [flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.4 [flutter meta path_provider_platform_interface] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.4 [ffi flutter meta path path_provider_platform_interface win32] - petitparser 4.4.0 [meta] - platform 3.0.0 - plugin_platform_interface 2.0.2 [meta] - process 4.2.3 [file path platform] - pub_semver 2.1.0 [collection meta] - pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml] - rfc_6901 0.1.0 - sky_engine 0.0.99 - source_span 1.8.1 [collection path term_glyph] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - string_scanner 1.1.0 [charcode source_span] - sync_http 0.3.0 - term_glyph 1.2.0 - test_api 0.4.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - typed_data 1.3.0 [collection] - universal_io 2.0.4 [collection crypto meta typed_data] - vector_math 2.1.0 - version_manipulation 0.1.0 [pub_semver] - vm_service 7.1.1 - webdriver 3.0.0 [archive matcher path stack_trace sync_http] - win32 2.3.1 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.3.1 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner]