firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.58k stars 3.94k forks source link

🐛 [firebase_dynamic_links] getInitialLink won't return null after first attempt #8556

Closed YDA93 closed 2 years ago

YDA93 commented 2 years ago

Bug report

getInitialLink is always returning the initial link and is never reset. Causing the app to open the link on every hot restart.

According to getInitialLink documentation:

This method always returns a Future. 
That Future completes to null if there is no pending dynamic link or any call to this method after the the first attempt.

Steps to reproduce

Steps to reproduce the behavior:

  1. Must open the app with a dynamic link.

  2. Run this anywhere:

    print(await FirebaseDynamicLinks.instance.getInitialLink());
    print(await FirebaseDynamicLinks.instance.getInitialLink());

Expected behavior

Only the first should print the link and the other should print null.

Flutter doctor

Click To Expand ``` [✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-arm, locale en-KW) • Flutter version 2.10.5 at /Users/yousefalmutairi/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5464c5bac7 (12 days ago), 2022-04-18 09:55:37 -0700 • Engine revision 57d3bac3dd • Dart version 2.16.2 • DevTools version 2.9.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/yousefalmutairi/Library/Android/sdk • Platform android-31, build-tools 30.0.3 • Java binary at: /Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home/bin/java • Java version Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) [✓] VS Code (version 1.66.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.38.1 [✓] Connected device (3 available) • iPhone (mobile) • 00008030-000134911482802E • ios • iOS 15.4.1 19E258 • macOS (desktop) • macos • darwin-arm64 • macOS 12.3.1 21E258 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.127 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found! ```

Flutter dependencies

Click To Expand ``` Dart SDK 2.16.2 Flutter SDK 2.10.5 fesale 2.8.4+111 dependencies: - animations 2.0.2 [flutter] - auto_route 3.2.4 [flutter path collection meta universal_html] - auto_size_text 3.0.0 [flutter] - badges 2.0.2 [flutter] - card_swiper 2.0.3 [flutter] - carousel_slider 4.1.1 [flutter] - cloud_firestore 3.1.13 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - convex_bottom_bar 3.0.0 [flutter] - country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform] - crypto 3.0.1 [collection typed_data] - dio 4.0.6 [http_parser path] - expandable_text 2.3.0 [flutter] - extended_image 6.0.3 [extended_image_library flutter meta] - feature_discovery 0.14.1 [flutter provider shared_preferences] - file_picker 4.5.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - firebase_analytics 9.1.6 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_check 0.0.6+10 [firebase_app_check_platform_interface firebase_app_check_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 3.3.16 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.15.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.6.3 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_database 9.0.12 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter] - firebase_dynamic_links 4.2.1 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_messaging 11.2.15 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_performance 0.8.0+10 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - flutter 0.0.0 [characters collection material_color_utilities meta typed_data vector_math sky_engine] - flutter_blurhash 0.7.0 [flutter] - flutter_easyloading 3.0.3 [flutter flutter_spinkit] - flutter_email_sender 5.1.0 [flutter] - flutter_facebook_auth 4.3.0 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web] - flutter_hooks 0.18.3 [flutter] - flutter_html 2.2.1 [html csslib flutter_layout_grid video_player chewie webview_flutter chewie_audio flutter_svg flutter_math_fork collection numerus flutter] - flutter_local_notifications 9.4.1 [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 typed_data vector_math] - flutter_native_splash 2.1.6 [args flutter flutter_web_plugins image js lint meta path universal_io xml yaml] - flutter_rating_bar 4.0.0 [flutter] - flutter_ringtone_player 3.2.0 [flutter path_provider] - flutter_secure_storage 5.0.2 [meta flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows] - flutter_slidable 1.2.0 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta typed_data vector_math] - font_awesome_flutter 9.0.0 [flutter] - google_fonts 2.3.2 [flutter http path_provider crypto] - google_sign_in 5.3.0 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - image_picker 0.8.5 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - in_app_review 2.0.4 [flutter in_app_review_platform_interface] - infinite_scroll_pagination 3.1.0 [flutter sliver_tools] - internet_connection_checker 0.0.1+3 - intl 0.17.0 [clock path] - intl_phone_number_input 0.7.0+2 [flutter meta libphonenumber_plugin equatable collection] - introduction_screen 3.0.2 [flutter dots_indicator collection] - like_button 2.0.4 [flutter] - local_auth 2.0.0 [flutter intl local_auth_android local_auth_ios local_auth_platform_interface] - open_store 0.2.4 [flutter url_launcher] - package_info_plus 1.4.2 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web] - path_provider 2.0.9 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - permission_handler 9.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - photo_view 0.13.0 [flutter] - pin_code_fields 7.4.0 [flutter] - provider 6.0.2 [collection flutter nested] - share_plus 4.0.4 [meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web] - shared_preferences 2.0.13 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shimmer 2.0.0 [flutter] - sign_in_with_apple 3.3.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web] - soundpool 2.3.0 [flutter soundpool_platform_interface soundpool_web soundpool_macos] - timeago 3.2.2 - tuple 2.0.0 [quiver] - url_launcher 6.1.0 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - validators 3.0.0 - version 2.0.0 - whatsapp_unilink 2.0.1+1 dev dependencies: - analyzer 3.4.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - auto_route_generator 3.2.3 [build source_gen analyzer path build_runner code_builder dart_style auto_route] - build_runner 2.1.10 [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] - flutter_launcher_icons 0.9.2 [args image path yaml] - 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 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 material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math webdriver] - lint 1.8.2 - logger 1.1.0 dependency overrides: - font_awesome_flutter 9.0.0 [flutter] - webview_flutter 3.0.2 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] transitive dependencies: - _fe_analyzer_shared 38.0.0 [meta] - archive 3.1.6 [crypto path] - args 2.3.0 - async 2.8.2 [collection meta] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.3.0 [analyzer async convert crypto glob logging meta path] - build_config 1.0.0 [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.0.8 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.3 [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.2.3 [built_collection collection fixnum meta] - characters 1.2.0 - charcode 1.3.1 - checked_yaml 2.0.1 [json_annotation source_span yaml] - chewie 1.3.2 [cupertino_icons flutter provider video_player wakelock very_good_analysis] - chewie_audio 1.3.0 [cupertino_icons flutter video_player] - clock 1.1.0 - cloud_firestore_platform_interface 5.5.4 [collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 2.6.13 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - code_builder 4.1.0 [built_collection built_value collection matcher meta] - collection 1.15.0 - convert 3.0.1 [typed_data] - cross_file 0.3.2 [flutter js meta] - csslib 0.17.1 [source_span] - cupertino_icons 1.0.4 - dart_style 2.2.3 [analyzer args path pub_semver source_span] - dbus 0.7.3 [args ffi meta xml] - dots_indicator 2.1.0 [flutter] - equatable 2.0.3 [collection meta] - extended_image_library 3.1.4 [crypto flutter http_client_helper path path_provider] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase 9.0.2 [http http_parser js] - firebase_analytics_platform_interface 3.1.4 [firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.4.0+11 [firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_app_check_platform_interface 0.0.4+4 [firebase_core flutter meta plugin_platform_interface] - firebase_app_check_web 0.0.5+10 [firebase_app_check_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.2.4 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 3.3.13 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.2.5 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.6.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.2.4 [collection firebase_core flutter meta plugin_platform_interface] - firebase_database_platform_interface 0.2.1+4 [collection firebase_core flutter meta plugin_platform_interface] - firebase_database_web 0.2.0+11 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins js] - firebase_dynamic_links_platform_interface 0.2.3 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 3.3.1 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 2.2.13 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_performance_platform_interface 0.1.1+4 [firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.0+10 [firebase firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - fixnum 1.0.0 - 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_facebook_auth_platform_interface 3.1.0 [flutter plugin_platform_interface] - flutter_facebook_auth_web 3.1.0 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface] - flutter_layout_grid 1.0.6 [flutter collection meta quiver] - flutter_local_notifications_linux 0.4.2 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories] - flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface] - flutter_math_fork 0.5.0 [flutter flutter_svg provider meta collection tuple] - flutter_plugin_android_lifecycle 2.0.5 [flutter] - flutter_secure_storage_linux 1.1.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_macos 1.1.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_platform_interface 1.0.0 [flutter plugin_platform_interface] - flutter_secure_storage_web 1.0.2 [flutter flutter_web_plugins flutter_secure_storage_platform_interface js] - flutter_secure_storage_windows 1.1.2 [flutter flutter_secure_storage_platform_interface] - flutter_spinkit 5.1.0 [flutter] - flutter_svg 0.23.0+1 [flutter meta path_drawing vector_math xml] - 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] - google_sign_in_android 5.2.6 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.2.6 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.1.2 [flutter quiver] - google_sign_in_web 0.10.1 [flutter flutter_web_plugins google_sign_in_platform_interface js] - graphs 2.1.0 [collection] - html 0.15.0 [csslib source_span] - http 0.13.4 [async http_parser meta path] - http_client_helper 2.0.2 [http] - http_multi_server 3.2.0 [async] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.1.3 [archive meta xml] - image_picker_android 0.8.4+11 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.6 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.5 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.4.4 [cross_file flutter http plugin_platform_interface] - in_app_review_platform_interface 2.0.3 [flutter url_launcher plugin_platform_interface platform] - io 1.0.3 [meta path string_scanner] - js 0.6.3 - json_annotation 4.5.0 [meta] - libphonenumber 2.0.2 [flutter meta] - libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface] - libphonenumber_plugin 0.2.3 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web libphonenumber] - libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface] - lints 1.0.1 - local_auth_android 1.0.2 [flutter flutter_plugin_android_lifecycle intl local_auth_platform_interface] - local_auth_ios 1.0.4 [flutter intl local_auth_platform_interface] - local_auth_platform_interface 1.0.3 [flutter intl plugin_platform_interface] - logging 1.0.2 - 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.1 [flutter] - nested 1.0.0 [flutter] - numerus 1.1.1 - package_config 2.0.2 [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.5 [flutter flutter_web_plugins http meta package_info_plus_platform_interface] - package_info_plus_windows 1.0.5 [package_info_plus_platform_interface ffi flutter win32] - path 1.8.0 - path_drawing 0.5.1+1 [vector_math meta path_parsing flutter] - path_parsing 0.2.1 [vector_math meta] - path_provider_android 2.0.13 [flutter path_provider_platform_interface] - path_provider_ios 2.0.8 [flutter path_provider_platform_interface] - path_provider_linux 2.1.5 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.5 [flutter path_provider_platform_interface] - path_provider_platform_interface 2.0.3 [flutter platform plugin_platform_interface] - path_provider_windows 2.0.5 [ffi flutter path path_provider_platform_interface win32] - permission_handler_android 9.0.2+1 [flutter permission_handler_platform_interface] - permission_handler_apple 9.0.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.0 [flutter permission_handler_platform_interface] - petitparser 4.4.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.2 [meta] - pool 1.5.0 [async stack_trace] - process 4.2.4 [file path platform] - pub_semver 2.1.1 [collection meta] - pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml] - quiver 3.0.1+1 [matcher] - share_plus_linux 3.0.0 [share_plus_platform_interface file flutter meta url_launcher] - share_plus_macos 3.0.0 [share_plus_platform_interface flutter] - share_plus_platform_interface 3.0.2 [flutter meta mime plugin_platform_interface] - share_plus_web 3.0.0 [share_plus_platform_interface url_launcher flutter flutter_web_plugins meta] - share_plus_windows 3.0.0 [share_plus_platform_interface flutter meta url_launcher] - shared_preferences_android 2.0.11 [flutter shared_preferences_platform_interface] - shared_preferences_ios 2.1.0 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_macos 2.0.3 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.3 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.3.0 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel] - sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta] - sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js] - sky_engine 0.0.99 - sliver_tools 0.2.6 [flutter] - soundpool_macos 2.2.0 [flutter soundpool_platform_interface] - soundpool_platform_interface 2.1.0 [flutter meta plugin_platform_interface] - soundpool_web 2.2.0 [flutter flutter_web_plugins soundpool_platform_interface http] - source_gen 1.2.2 [analyzer async build dart_style glob meta path source_span yaml] - source_span 1.8.1 [collection path term_glyph] - 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 - term_glyph 1.2.0 - test_api 0.4.8 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timezone 0.8.0 [path] - timing 1.0.0 [json_annotation] - typed_data 1.3.0 [collection] - universal_html 2.0.8 [async csslib charcode collection html meta source_span typed_data universal_io] - universal_io 2.0.4 [collection crypto meta typed_data] - universal_platform 1.0.0+1 - url_launcher_android 6.0.16 [flutter url_launcher_platform_interface] - url_launcher_ios 6.0.15 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.0 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.0.5 [flutter plugin_platform_interface] - url_launcher_web 2.0.9 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.0 [flutter url_launcher_platform_interface] - vector_math 2.1.1 - very_good_analysis 2.4.0 - video_player 2.4.0 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web] - video_player_android 2.3.2 [flutter video_player_platform_interface] - video_player_avfoundation 2.3.3 [flutter video_player_platform_interface] - video_player_platform_interface 5.1.2 [flutter plugin_platform_interface] - video_player_web 2.0.8 [flutter flutter_web_plugins video_player_platform_interface] - vm_service 7.5.0 - wakelock 0.6.1+2 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows] - wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface] - wakelock_platform_interface 0.3.0 [flutter meta] - wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface] - wakelock_windows 0.2.0 [flutter wakelock_platform_interface win32] - watcher 1.0.1 [async path] - web_socket_channel 2.2.0 [async crypto stream_channel] - webdriver 3.0.0 [archive matcher path stack_trace sync_http] - webview_flutter_android 2.8.6 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 1.8.1 [flutter plugin_platform_interface] - webview_flutter_wkwebview 2.7.3 [flutter path webview_flutter_platform_interface] - win32 2.5.2 [ffi] - xdg_directories 0.2.0+1 [meta path process] - xml 5.3.1 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```

darshankawar commented 2 years ago

@YDA93 Is this occuring on iOS or Android ? A similar issue was fixed : https://github.com/firebase/flutterfire/issues/6784.

YDA93 commented 2 years ago

@YDA93

Is this occuring on iOS or Android ?

A similar issue was fixed : https://github.com/firebase/flutterfire/issues/6784.

I tested in IOS only.

darshankawar commented 2 years ago

@YDA93 Thanks for the update. I tried the same scenario using plugin's example on iOS and observed below:

After generating either a long link or a short link and then tapping on getInitialLink(), it first prints below:

flutter: PendingDynamicLinkData(Closure: () => Map<String, dynamic> from Function 'asMap':.)

onPressed: () async {
                          final PendingDynamicLinkData? data =
                              await dynamicLinks.getInitialLink();
                          print(data);
                          final Uri? deepLink = data?.link;

                          if (deepLink != null) {
                            // ignore: unawaited_futures
                            Navigator.pushNamed(context, deepLink.path);
                          }
                        },

Then tapping on getInitialLink() again prints the same output. Note that, the what's the output printed doesn't matter in this case, but it is printing other than null in both cases.

In second attempt, it should print null right instead of the current output I shared above ? Is this the correct interpretation of the issue ?

YDA93 commented 2 years ago

Hi @darshankawar,

Sorry I think this is correct interpretation of the issue:

final link1 = await FirebaseDynamicLinks.instance.getInitialLink();
final link2 = await FirebaseDynamicLinks.instance.getInitialLink();
final link3 = await FirebaseDynamicLinks.instance.getInitialLink();

print(link1?.link.path);  // prints the link, which is correct
print(link2?.link.path);  // prints the link, wrong should return null instead
print(link3?.link.path);  // prints the link, wrong should return null instead
darshankawar commented 2 years ago

Thanks for the update. Using above snippet, I get the same behavior as reported.

A similar issue was fixed earlier https://github.com/firebase/flutterfire/issues/6784