Skip to content

🐛 [firebase_dynamic_links] onLink does not trigger on iOS #10340

Closed
@ivanesi

Description

@ivanesi

Bug report

I am trying to implement Firebase Dynamic links in a flutter app. When I click on the link it opens the app but onLink listener doesn't work.

  • onLink listener works perfect on Android.

  • I'm using real iOS device. Tested both debug and release mode.

  • https://link.custom.domain/apple-app-site-association passed.

I reconfigured step by step according to FlutterFire:

  • Info.plist is set via Xcode:
...
<key>CFBundleURLName</key>
<string>com.appName.app</string> // correct bundleId
<key>CFBundleURLSchemes</key>
    <array>
	<string>com.appName.app</string> // correct bundleId
    </array>

...

<key>FirebaseDynamicLinksCustomDomains</key>
    <array>
        <string>https://link.leclick.ru</string>
   </array>

-Runner.entitlements is set via Xcode:

...
        <key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:link.custom.domain</string> //correct custom domain
		<string>applinks:app.page.link</string> // correct link
	</array>
	<key>com.apple.security.application-groups</key>
	<array>
                 <string>group.cloud.Mindbox.ru.leclick.application</string>
	</array>
...

Firebase is correctly initialized in my app as I'm using other services.

  • Run flutterfire configure

  • Run app:

WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseDynamicLinks.instance.onLink.listen(print, onError: print);

FirebaseDynamicLinks.instance.app.options has apiKey , appId, projectId , ios, iosBundleId, iosClientId, some other props, but deepLinkURLScheme is null.

  • Run app, collapse, tap correct dynamic link, see logs:
10.3.0 - [FirebaseAnalytics][I-ACS023007] Analytics v.10.3.0 started
10.3.0 - [FirebaseAnalytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
    "match_message" = "No pre-install link matched for this device.";
    "request_ip_version" = "IP_V6";
}
...
flutter: MyAppState - didChangeAppLifecycleState(AppLifecycleState.inactive)
flutter: MyAppState - didChangeAppLifecycleState(AppLifecycleState.resumed)

Nothing happened.

Handling initial link also doesn't work. Tested on real device in release build mode.

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, 3.3.10, on macOS 12.2.1 21D62 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.74.3)
[✓] 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.18.6
Flutter SDK 3.3.10
leclick 4.0.4+92

dependencies:
- app_settings 4.2.0 [flutter]
- appmetrica_plugin 1.1.0 [flutter stack_trace logging decimal]
- auto_route 5.0.4 [flutter path collection meta]
- cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- collection 1.16.0
- dartz 0.10.1
- device_info_plus 8.0.0 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32]
- dio 4.0.6 [http_parser path]
- equatable 2.0.5 [collection meta]
- expandable_text 2.3.0 [flutter]
- firebase_analytics 10.1.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_core 2.4.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.0.11 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_dynamic_links 5.0.11 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface]
- flushbar 1.10.4 [flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_bloc 8.1.1 [flutter bloc provider]
- flutter_exif_rotation 0.5.1 [flutter]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_native_splash 2.2.16 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml]
- flutter_rating_bar 4.0.1 [flutter]
- flutter_staggered_grid_view 0.6.2 [flutter]
- geolocator 9.0.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- get_it 7.2.0 [async collection]
- image_cropper 3.0.1 [flutter image_cropper_platform_interface image_cropper_for_web]
- image_picker 0.8.6+1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
- internet_connection_checker 1.0.0+1
- intl 0.17.0 [clock path]
- intl_phone_number_input 0.7.2 [flutter libphonenumber_plugin equatable collection]
- logging 1.1.1
- mindbox 2.2.0 [flutter mindbox_android mindbox_ios mindbox_platform_interface]
- numberpicker 2.1.1 [flutter infinite_listview]
- permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
- photo_view 0.14.0 [flutter]
- pinput 2.2.21 [flutter smart_auth]
- share_plus 6.3.0 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32]
- shared_preferences 2.0.17 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- skeletons 0.0.3 [flutter]
- url_launcher 6.1.8 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- web_socket_channel 2.3.0 [async crypto stream_channel]
- yandex_mapkit 3.2.0 [flutter_plugin_android_lifecycle equatable collection flutter]

dev dependencies:
- auto_route_generator 5.0.3 [build source_gen analyzer path build_runner code_builder dart_style xml args auto_route]
- 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]
- dependency_validator 3.2.2 [args build_config checked_yaml glob io json_annotation logging package_config path pub_semver pubspec_parse yaml]
- flutter_launcher_icons 0.11.0 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_lints 2.0.1 [lints]

transitive dependencies:
- _fe_analyzer_shared 50.0.0 [meta]
- _flutterfire_internals 1.0.12 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 5.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.3.5 [crypto path pointycastle]
- args 2.3.2
- async 2.9.0 [collection meta]
- bloc 8.1.0 [meta]
- boolean_selector 2.1.0 [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.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.1.0 [analyzer async build 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.3 [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]
- 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]
- convert 3.1.1 [typed_data]
- cross_file 0.3.3+2 [js meta]
- crypto 3.0.2 [typed_data]
- csslib 0.17.2 [source_span]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- decimal 2.3.2 [rational]
- device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface]
- fake_async 1.3.1 [clock collection]
- ffi 2.0.1
- file 6.1.4 [meta path]
- firebase_analytics_platform_interface 3.3.17 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.1+8 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_core_platform_interface 4.5.2 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.3.11 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_dynamic_links_platform_interface 0.2.3+26 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- fixnum 1.0.1
- 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_plugin_android_lifecycle 2.0.7 [flutter]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection 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]
- geolocator_android 4.1.7 [flutter geolocator_platform_interface]
- geolocator_apple 2.2.5 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.0.7 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface]
- geolocator_windows 0.1.1 [flutter geolocator_platform_interface]
- glob 2.1.1 [async collection file path string_scanner]
- graphs 2.2.0 [collection]
- html 0.15.1 [csslib source_span]
- http 0.13.5 [async http_parser meta path]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image 3.3.0 [archive meta xml]
- image_cropper_for_web 1.0.3 [flutter flutter_web_plugins image_cropper_platform_interface js]
- image_cropper_platform_interface 3.0.3 [flutter plugin_platform_interface http]
- image_picker_android 0.8.5+5 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 2.1.10 [flutter flutter_web_plugins image_picker_platform_interface]
- image_picker_ios 0.8.6+6 [flutter image_picker_platform_interface]
- image_picker_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface]
- infinite_listview 1.1.0 [flutter]
- io 1.0.4 [meta path string_scanner]
- js 0.6.4
- json_annotation 4.8.0 [meta]
- libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface]
- libphonenumber_plugin 0.2.5 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web]
- libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface]
- lints 2.0.1
- matcher 0.12.12 [stack_trace]
- material_color_utilities 0.1.5
- meta 1.8.0
- mime 1.0.4
- mindbox_android 2.2.0 [flutter mindbox_platform_interface]
- mindbox_ios 2.1.3 [flutter mindbox_platform_interface]
- mindbox_platform_interface 2.1.1 [flutter]
- nested 1.0.0 [flutter]
- octo_image 1.0.2 [flutter flutter_blurhash]
- package_config 2.1.0 [path]
- path 1.8.2
- path_provider 2.0.12 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- path_provider_android 2.0.22 [flutter path_provider_platform_interface]
- path_provider_foundation 2.1.1 [flutter path_provider_platform_interface]
- path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.0.5 [flutter platform plugin_platform_interface]
- path_provider_windows 2.1.3 [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.7 [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.3 [meta]
- pointycastle 3.6.2 [collection convert js]
- pool 1.5.1 [async stack_trace]
- process 4.2.4 [file path platform]
- provider 6.0.5 [collection flutter nested]
- pub_semver 2.1.3 [collection meta]
- pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml]
- rational 2.2.2
- rxdart 0.27.7
- share_plus_platform_interface 3.2.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- shared_preferences_android 2.0.15 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.1.2 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.1.3 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.1.0 [flutter plugin_platform_interface]
- shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.1.3 [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_web_socket 1.0.3 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- smart_auth 1.0.8 [flutter flutter_web_plugins]
- source_gen 1.2.6 [analyzer async build dart_style glob meta path source_span yaml]
- source_span 1.9.0 [collection path term_glyph]
- sqflite 2.2.4+1 [flutter sqflite_common path]
- sqflite_common 2.4.2+2 [synchronized path meta]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.1.0
- string_scanner 1.1.1 [source_span]
- synchronized 3.0.1
- term_glyph 1.2.1
- test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.1 [collection]
- universal_io 2.0.4 [collection crypto meta typed_data]
- url_launcher_android 6.0.23 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.0.18 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.0.2 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.0.2 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.1.1 [flutter plugin_platform_interface]
- url_launcher_web 2.0.14 [flutter flutter_web_plugins url_launcher_platform_interface]
- url_launcher_windows 3.0.3 [flutter url_launcher_platform_interface]
- uuid 3.0.7 [crypto]
- vector_math 2.1.2
- watcher 1.0.2 [async path]
- win32 3.1.3 [ffi]
- xdg_directories 0.2.0+3 [meta path process]
- xml 6.1.0 [collection meta petitparser]
- yaml 3.1.1 [collection source_span string_scanner]

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleIssue with no recent activityresolution: invalidThis doesn't seem right and might not belong here.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions