flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [firebase_dynamic_links] utmParameters in PendingDynamicLinkData are empty on Android

Open darwin-morocho opened this issue 2 years ago • 6 comments

Bug report

Describe the bug Using getInitialLink() or onLink to get the dynamic link info utmParameters in PendingDynamicLinkData are always empty on Android.

On iOS it works perfect.

Steps to reproduce

Steps to reproduce the behavior:

  • Go to your firebase console
  • Create a dynamic links with UTMS image

Expected behavior

Using getInitialLink() or onLink must return the UTM parameters on Aandroid.

Sample project

The next code works fine on android and ios

    String link = 'https://testcriptan.page.link/zEuj';

    final initialLink = await FirebaseDynamicLinks.instance.getDynamicLink(
      Uri.parse(link),
    );

    if (initialLink != null) {
      print('✅ utmParameters ${initialLink.utmParameters}'); // print {utm_campaign: Spring jaja, utm_medium: cpc, utm_source: Google}
    }

but if you use this code to listen when the app was opened with a dynamic link or when the app is running utmParameters always returns an empty Map.

    final initialLink = await FirebaseDynamicLinks.instance.getInitialLink();
    print(${initialLink?.utmParameters); /// print {}


    FirebaseDynamicLinks.instance.onLink.listen(
      (data) {
        if (!data.link.hasEmptyPath) {
             print('✅ data.utmParameters ${data.utmParameters}'); /// print {}
        }
      },
    );
  }

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.2 21D49 darwin-arm, locale es-419)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.68.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.17.3
Flutter SDK 3.0.2
criptan_app 2.5.91+400

dependencies:
- amplitude_flutter 3.8.1 [flutter flutter_web_plugins js]
- app_settings 4.1.1 [flutter]
- app_tracking_transparency 2.0.2+1 [flutter]
- appsflyer_sdk 6.4.0+2 [flutter]
- auto_size_text 3.0.0 [flutter]
- badges 2.0.2 [flutter]
- cached_network_image 3.2.0 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- connectivity 3.0.6 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform]
- cupertino_icons 1.0.4
- datadog_flutter 1.4.0 [meta logging http flutter flutter_web_plugins js]
- device_info_plus 2.2.0 [flutter device_info_plus_platform_interface device_info_plus_linux device_info_plus_macos device_info_plus_web device_info_plus_windows]
- device_preview 1.0.0 [flutter flutter_localizations provider device_frame freezed_annotation json_annotation shared_preferences]
- dots_indicator 2.0.0 [flutter]
- dotted_border 2.0.0+2 [flutter path_drawing]
- equatable 2.0.3 [collection meta]
- file_picker 4.5.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32]
- firebase_analytics 9.1.7 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_auth 3.3.17 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.16.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_dynamic_links 4.2.6 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface]
- firebase_messaging 11.3.0 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_performance 0.8.0+11 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter]
- firebase_remote_config 2.0.6 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter]
- fl_chart 0.41.0 [flutter equatable]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_local_notifications 9.1.5 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_markdown 0.6.9 [flutter markdown meta path]
- flutter_multi_formatter 2.5.1 [flutter collection base58check bech32]
- flutter_svg 1.0.3 [flutter meta path_drawing vector_math xml]
- freezed_annotation 0.15.0 [collection json_annotation meta]
- get 4.6.1 [flutter]
- get_storage 2.0.3 [flutter get path_provider]
- google_fonts 2.1.0 [flutter http path_provider crypto]
- http 0.13.4 [async http_parser meta path]
- image_picker 0.8.4+11 [flutter flutter_plugin_android_lifecycle image_picker_for_web image_picker_platform_interface]
- in_app_review 2.0.3 [flutter in_app_review_platform_interface]
- intl 0.17.0 [clock path]
- json_annotation 4.4.0 [meta]
- local_auth 1.1.11 [flutter flutter_plugin_android_lifecycle intl platform]
- onesignal_flutter 3.3.1 [flutter]
- 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]
- permission_handler 8.3.0 [flutter meta permission_handler_platform_interface]
- phone_numbers_parser 5.0.3 [phone_number_metadata meta dart_countries]
- pin_code_fields 7.3.0 [flutter]
- pretty_qr_code 2.0.2 [flutter qr]
- qr_code_scanner 0.6.1 [js flutter flutter_web_plugins]
- rive 0.7.23 [collection flutter graphs http meta]
- rxdart 0.26.0
- shared_preferences 2.0.11 [flutter meta shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- simple_rich_text 2.0.49 [flutter url_launcher]
- sprintf 6.0.0
- story_view 0.13.1 [flutter flutter_cache_manager rxdart video_player collection]
- super_text 0.1.1 [flutter equatable]
- tuple 2.0.0 [quiver]
- url_launcher 6.0.17 [flutter meta url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- webview_flutter 3.0.0 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview]
- zendesk2 2.0.0+1 [flutter]

dev dependencies:
- build_runner 2.1.8 [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 4.8.1 [analyzer analyzer_plugin ansicolor args collection crypto file glob html meta path source_span yaml]
- firebase_auth_mocks 0.8.4 [flutter firebase_auth meta equatable]
- 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 material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math]
- flutter_gen_runner 4.1.6 [flutter_gen_core build]
- flutter_lints 1.0.4 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]
- freezed 0.15.1+1 [analyzer build build_config collection meta source_gen freezed_annotation]
- 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 material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math webdriver]
- json_serializable 6.1.6 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- mocktail 0.1.4 [collection matcher test]

dependency overrides:
- freezed_annotation 0.15.0 [collection json_annotation meta]

transitive dependencies:
- _fe_analyzer_shared 31.0.0 [meta]
- analyzer 2.8.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- analyzer_plugin 0.8.0 [analyzer collection dart_style pub_semver yaml]
- ansicolor 2.0.1
- archive 3.1.6 [crypto path]
- args 2.3.0
- async 2.8.2 [collection meta]
- base58check 2.0.0 [crypto collection]
- bech32 0.2.1 [convert]
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.1.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.0.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.5 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.2 [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.1.3 [built_collection collection fixnum meta]
- cached_network_image_platform_interface 1.0.0 [flutter flutter_cache_manager]
- cached_network_image_web 1.0.1 [flutter flutter_cache_manager cached_network_image_platform_interface]
- characters 1.2.0
- charcode 1.3.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cli_util 0.3.5 [meta path]
- clock 1.1.0
- code_builder 4.1.0 [built_collection built_value collection matcher meta]
- collection 1.15.0
- color 3.0.0
- connectivity_for_web 0.4.0+1 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.2.1+2 [flutter connectivity_platform_interface]
- connectivity_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- convert 3.0.1 [typed_data]
- coverage 1.0.3 [args logging package_config path source_maps stack_trace vm_service]
- cross_file 0.3.2 [flutter js meta]
- crypto 3.0.1 [collection typed_data]
- csslib 0.17.1 [source_span]
- dart_countries 3.0.2
- dart_style 2.2.0 [analyzer args path pub_semver source_span]
- dartx 1.0.0 [characters collection crypto meta path time]
- dbus 0.6.6 [args ffi meta xml]
- device_frame 1.0.0 [freezed_annotation flutter]
- device_info_plus_linux 2.1.0 [device_info_plus_platform_interface file flutter meta]
- device_info_plus_macos 2.2.0 [device_info_plus_platform_interface flutter]
- device_info_plus_platform_interface 2.2.1 [flutter meta plugin_platform_interface]
- device_info_plus_web 2.1.0 [device_info_plus_platform_interface flutter_web_plugins flutter]
- device_info_plus_windows 2.1.0 [device_info_plus_platform_interface ffi flutter win32]
- fake_async 1.2.0 [clock collection]
- ffi 1.1.2
- file 6.1.2 [meta path]
- firebase 9.0.3 [http http_parser js]
- firebase_analytics_platform_interface 3.1.5 [firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.4.0+12 [firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_auth_platform_interface 6.2.5 [firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 3.3.14 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.4.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.6.3 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_dynamic_links_platform_interface 0.2.3+4 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 3.4.0 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.3.0 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- firebase_performance_platform_interface 0.1.1+5 [firebase_core flutter plugin_platform_interface]
- firebase_performance_web 0.1.0+11 [firebase firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js]
- firebase_remote_config_platform_interface 1.1.5 [firebase_core flutter meta plugin_platform_interface]
- firebase_remote_config_web 1.0.11 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js]
- fixnum 1.0.0
- flutter_blurhash 0.6.0 [flutter meta pedantic]
- flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
- flutter_gen_core 4.1.6 [path yaml mime xml dartx color collection json_annotation dart_style analyzer args pub_semver source_span]
- flutter_local_notifications_linux 0.4.0 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories]
- flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface]
- flutter_plugin_android_lifecycle 2.0.5 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- frontend_server_client 2.1.2 [async path]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- glob 2.0.2 [async collection file path string_scanner]
- graphs 2.1.0 [collection]
- html 0.15.0 [csslib source_span]
- http_multi_server 3.0.1 [async]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- image_picker_for_web 2.1.4 [flutter flutter_web_plugins image_picker_platform_interface meta]
- image_picker_platform_interface 2.4.1 [flutter http meta plugin_platform_interface cross_file]
- in_app_review_platform_interface 2.0.2 [flutter url_launcher plugin_platform_interface platform]
- io 1.0.3 [meta path string_scanner]
- js 0.6.3
- lints 1.0.1
- logging 1.0.2
- markdown 4.0.1 [args charcode meta]
- matcher 0.12.11 [stack_trace]
- material_color_utilities 0.1.3
- meta 1.7.0
- mime 1.0.1
- modal_bottom_sheet 2.0.0 [flutter]
- nested 1.0.0 [flutter]
- node_preamble 2.0.1
- octo_image 1.0.1 [flutter flutter_blurhash]
- package_config 2.0.2 [path]
- 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_drawing 1.0.0 [vector_math meta path_parsing flutter]
- path_parsing 1.0.0 [vector_math meta]
- 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.3 [flutter]
- 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]
- pedantic 1.11.1
- permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
- petitparser 4.4.0 [meta]
- phone_number_metadata 5.0.3 [path dart_countries]
- platform 3.1.0
- plugin_platform_interface 2.0.2 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.2.4 [file path platform]
- provider 6.0.2 [collection flutter nested]
- pub_semver 2.1.0 [collection meta]
- pubspec_parse 1.1.0 [checked_yaml collection json_annotation pub_semver yaml]
- qr 2.1.0 [meta]
- quiver 3.0.1+1 [matcher]
- shared_preferences_android 2.0.9 [flutter meta shared_preferences_platform_interface]
- shared_preferences_ios 2.0.8 [flutter meta shared_preferences_platform_interface]
- shared_preferences_linux 2.0.3 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.2 [flutter shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.2 [flutter flutter_web_plugins meta shared_preferences_platform_interface]
- shared_preferences_windows 2.0.3 [file flutter meta path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.2.0 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.0 [path shelf shelf_static]
- shelf_static 1.1.0 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.2.0 [analyzer async build dart_style glob meta path source_span yaml]
- source_helper 1.3.2 [analyzer collection source_gen]
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- source_span 1.8.1 [collection path term_glyph]
- sqflite 2.0.0+4 [flutter sqflite_common path]
- sqflite_common 2.0.1+1 [synchronized path meta]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- sync_http 0.3.0
- synchronized 3.0.0
- term_glyph 1.2.0
- test 1.19.5 [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.8 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.4.9 [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.0 [clock]
- timezone 0.8.0 [path]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.0 [collection]
- universal_platform 1.0.0+1
- url_launcher_android 6.0.13 [flutter meta url_launcher_platform_interface]
- url_launcher_ios 6.0.13 [flutter meta url_launcher_platform_interface]
- url_launcher_linux 2.0.2 [flutter]
- url_launcher_macos 2.0.2 [flutter]
- url_launcher_platform_interface 2.0.4 [flutter plugin_platform_interface]
- url_launcher_web 2.0.5 [flutter flutter_web_plugins meta url_launcher_platform_interface]
- url_launcher_windows 2.0.2 [flutter]
- uuid 3.0.5 [crypto]
- vector_math 2.1.1
- video_player 2.2.7 [flutter meta video_player_platform_interface video_player_web html]
- video_player_platform_interface 4.2.0 [flutter flutter_test meta]
- video_player_web 2.0.4 [flutter flutter_web_plugins meta video_player_platform_interface]
- vm_service 7.5.0
- watcher 1.0.1 [async path]
- web_socket_channel 2.1.0 [async crypto stream_channel]
- webdriver 3.0.0 [archive matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.0.0 [logging]
- webview_flutter_android 2.8.0 [flutter webview_flutter_platform_interface]
- webview_flutter_platform_interface 1.8.0 [flutter plugin_platform_interface]
- webview_flutter_wkwebview 2.7.1 [flutter webview_flutter_platform_interface]
- win32 2.4.2 [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]

darwin-morocho avatar Jun 22 '22 13:06 darwin-morocho

I faced the same issue and in some cases I managed to get the utm parameters at launch of a debug app, but never using onLink listener.

Skogsfrae avatar Jun 23 '22 10:06 Skogsfrae

Thanks for the report. This was probably fixed for iOS as part of this issue and PR : https://github.com/firebase/flutterfire/issues/8217 / https://github.com/firebase/flutterfire/pull/8232

/cc @russellwheatley

darshankawar avatar Jun 27 '22 11:06 darshankawar

I have tested this issue.

Case A:

  • Opened the dynamic link in the browser (Chrome).
  • Browser redirects to the corresponding mobile app.
  • FirebaseDynamicLinks.instance.onLink is called.
  • At this time UTM parameters are empty.

Case B:

  • Shared the dynamic link to someone via WhatsApp.
  • Clicked on the link from WhatsApp.
  • The mobile app is opened.
  • FirebaseDynamicLinks.instance.onLink is called.
  • At this time UTM parameters are present.

So it seems that UTM parameters are lost when the browser redirects to the mobile app.

@darwin-morocho do you have similar behavior?

deepak786 avatar Jun 29 '22 14:06 deepak786

I have tested this issue.

Case A:

  • Opened the dynamic link in the browser (Chrome).
  • Browser redirects to the corresponding mobile app.
  • FirebaseDynamicLinks.instance.onLink is called.
  • At this time UTM parameters are empty.

Case B:

  • Shared the dynamic link to someone via WhatsApp.
  • Clicked on the link from WhatsApp.
  • The mobile app is opened.
  • FirebaseDynamicLinks.instance.onLink is called.
  • At this time UTM parameters are present.

So it seems that UTM parameters are lost when the browser redirects to the mobile app.

@darwin-morocho do you have similar behavior?

@deepak786 You are right In my case the problem is when Browser redirects to the corresponding mobile app

darwin-morocho avatar Jun 29 '22 15:06 darwin-morocho

I have tested this issue. Case A:

  • Opened the dynamic link in the browser (Chrome).
  • Browser redirects to the corresponding mobile app.
  • FirebaseDynamicLinks.instance.onLink is called.
  • At this time UTM parameters are empty.

Case B:

  • Shared the dynamic link to someone via WhatsApp.
  • Clicked on the link from WhatsApp.
  • The mobile app is opened.
  • FirebaseDynamicLinks.instance.onLink is called.
  • At this time UTM parameters are present.

So it seems that UTM parameters are lost when the browser redirects to the mobile app. @darwin-morocho do you have similar behavior?

@deepak786 You are right In my case the problem is when Browser redirects to the corresponding mobile app

I am facing a similar issue but with query parameters when Browser redirects to the corresponding mobile app, I do not receive any query parameters.

n3rdkid avatar Jun 29 '22 15:06 n3rdkid

This isn't an issue with FlutterFire dynamic links plugin. With onLink, getInitialLink & getDynamicLink we use this method to pull out the utmParameters. For some reason, they aren't present. It is either a firebase-android-sdk issue or a problem with the way it is setup.

russellwheatley avatar Jul 27 '22 09:07 russellwheatley

UTM parameters will be empty if dynamic link host is not added in AndroidManifest. Reference

Gaurav192 avatar Oct 07 '22 23:10 Gaurav192

@Gaurav192 - can you confirm that you have UTM parameters appearing in your Flutter project? I've just added the intent-filter with dynamic link host and it still doesn't come through.

russellwheatley avatar Nov 08 '22 13:11 russellwheatley

Facing the same error here

carlosfiori avatar Nov 11 '22 13:11 carlosfiori

I've just tested this in the example app.

Using:

  Future<void> initDynamicLinks() async {
    dynamicLinks.onLink.listen((dynamicLinkData) {
      print('YYYY: ${dynamicLinkData?.utmParameters}');
      Navigator.pushNamed(context, dynamicLinkData.link.path);
    }).onError((error) {
      print('onLink error');
      print(error.message);
    });
  }

and received this in the console:

I/flutter (14054): YYYY: {utm_campaign: bar, utm_medium: foo, utm_source: Flutter}

I think this issue is fixed.

russellwheatley avatar Feb 01 '23 13:02 russellwheatley

This change probably fixed it. Documentation for flutter integration doesn't include Handling Dynamic Links using App Links section like android.

Gaurav192 avatar Feb 01 '23 13:02 Gaurav192