Flutterfire: ๐Ÿ› [firebase_auth] sendEmailVerification on iOS sends default link even with actionCodeSettings.

Created on 4 Oct 2020  ยท  4Comments  ยท  Source: FirebaseExtended/flutterfire

Bug report

When calling sendEmailVerification() on auth object along with actionCodeSettings, the default verification link is received in mail, but configured link with dynamic link as mentioned in actionCodeSettings should be received. It works in android, but it doesn't in iOS. I am testing in iOS emulator. I guess it shouldn't make a difference with a real device.

Steps to reproduce

Steps to reproduce the behavior:

  1. Authenticate user with Firebase auth.
  2. Create a actionCodeSettings object with your own dynamic link such as "example.page.link", along with android package name and iOS bundleId.
  3. Call user.sendEmailVerification(actionCodeSettings)
 var actionCodeSettings = ActionCodeSettings(
        url: "https://www.example.org/?email=$email",
        dynamicLinkDomain: "example.page.link",
        android: {
          "packageName": "com.example.app",
          "installApp": true,
          "minimumVersion": "10"
        },
        iOS: {"bundleId": "com.example.app"},
        handleCodeInApp: true);
await auth.sendEmailVerification(actionCodeSettings);

The email received in mail starts with: https://example.firebaseapp.com/..... which is incorrect.

Expected behavior

The email received in mail should be configured as per the actionSettings parameters passed.

The desired email link should start with: https://example.page.link?.....

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 master, 1.23.0-8.0.pre.99, on Mac OS X 10.15.7 19H2 x86_64, locale en-IN)

[โœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[โœ“] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[โœ“] Android Studio (version 4.0)
[โœ“] VS Code (version 1.49.3)
[โœ“] Connected device (1 available)

โ€ข No issues found!


Flutter dependencies

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

Click To Expand

```
Dart SDK 2.11.0-180.0.dev
Flutter SDK 1.23.0-8.0.pre.99
food_angels 0.3.8+25

dependencies:

  • async 2.5.0-nullsafety.1 [collection]
  • country_code_picker 1.4.0 [flutter]
  • cupertino_icons 0.1.3
  • firebase_auth 0.18.0+1 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter]
  • firebase_core 0.5.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
  • firebase_dynamic_links 0.6.0+1 [flutter firebase_core]
  • flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
  • flutter_localizations 0.0.0 [flutter intl characters collection meta path typed_data vector_math]
  • flutter_paginator 0.0.6 [flutter]
  • flutter_rating_bar 3.0.1+1 [flutter]
  • flutter_slidable 0.5.5 [flutter]
  • flutter_svg 0.18.0 [path_drawing xml vector_math meta flutter]
  • geohash 0.2.1
  • geolocator 5.3.2+2 [flutter meta equatable google_api_availability location_permissions vector_math]
  • google_maps_flutter 0.5.29 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface]
  • google_sign_in 4.5.3 [google_sign_in_platform_interface flutter meta google_sign_in_web]
  • http 0.12.2 [http_parser path pedantic]
  • http_interceptor 0.3.2 [flutter http]
  • image_picker 0.6.7+4 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
  • in_app_update 1.1.11 [flutter]
  • intl 0.16.1 [path]
  • like_button 0.2.0 [flutter]
  • location 3.0.2 [flutter meta location_platform_interface location_web]
  • mailer2 1.2.5 [dart2_constant mime logging path intl charcode]
  • open_mail_app 0.0.3 [url_launcher flutter]
  • provider 4.3.2 [flutter nested collection]
  • rounded_letter 0.0.6 [flutter]
  • share 0.6.4+3 [meta flutter]
  • shared_preferences 0.5.8 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web]
  • sign_in_with_apple 2.5.2 [meta flutter]
  • sqflite 1.3.1 [flutter sqflite_common path]
  • stripe_sdk 2.4.3 [flutter http url_launcher uni_links mask_text_input_formatter]
  • toast 0.1.5 [flutter]
  • transparent_image 1.0.0
  • url_launcher 5.5.0 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos]

dev dependencies:

  • 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]

transitive dependencies:

  • boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
  • characters 1.1.0-nullsafety.3
  • charcode 1.2.0-nullsafety.1
  • clock 1.1.0-nullsafety.1
  • collection 1.15.0-nullsafety.3
  • convert 2.1.1 [charcode typed_data]
  • dart2_constant 1.0.2+dart2
  • equatable 1.2.4 [collection meta]
  • fake_async 1.2.0-nullsafety.1 [clock collection]
  • file 5.2.1 [intl meta path]
  • firebase 7.3.0 [http http_parser js]
  • firebase_auth_platform_interface 2.0.1 [flutter meta firebase_core plugin_platform_interface]
  • firebase_auth_web 0.3.0+1 [flutter flutter_web_plugins firebase meta http_parser intl firebase_core firebase_auth_platform_interface js]
  • firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
  • firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
  • flutter_plugin_android_lifecycle 1.0.8 [flutter]
  • flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
  • google_api_availability 2.0.4 [flutter]
  • google_maps_flutter_platform_interface 1.0.3 [flutter meta plugin_platform_interface stream_transform]
  • google_sign_in_platform_interface 1.1.2 [flutter meta quiver]
  • google_sign_in_web 0.9.1+1 [google_sign_in_platform_interface flutter flutter_web_plugins meta js]
  • http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
  • image_picker_platform_interface 1.1.0 [flutter meta http plugin_platform_interface]
  • js 0.6.2
  • location_permissions 3.0.0+1 [flutter meta]
  • location_platform_interface 1.0.0 [flutter meta plugin_platform_interface]
  • location_web 1.0.0 [flutter flutter_web_plugins location_platform_interface http_parser meta js]
  • logging 0.11.4
  • mask_text_input_formatter 1.0.7 [flutter]
  • matcher 0.12.10-nullsafety.1 [stack_trace]
  • meta 1.3.0-nullsafety.3
  • mime 0.9.6+3
  • nested 0.0.4 [flutter]
  • path 1.8.0-nullsafety.1
  • path_drawing 0.4.1 [vector_math meta path_parsing flutter]
  • path_parsing 0.1.4 [vector_math meta]
  • path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
  • path_provider_platform_interface 1.0.2 [flutter meta platform plugin_platform_interface]
  • pedantic 1.9.0
  • petitparser 3.0.4 [meta]
  • platform 2.2.1
  • platform_detect 1.4.0 [meta pub_semver]
  • plugin_platform_interface 1.0.2 [meta]
  • process 3.0.13 [file intl meta path platform]
  • pub_semver 1.4.4 [collection]
  • quiver 2.1.3 [matcher meta]
  • shared_preferences_linux 0.0.2+1 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
  • shared_preferences_macos 0.0.1+10 [shared_preferences_platform_interface flutter]
  • shared_preferences_platform_interface 1.0.4 [meta flutter]
  • shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
  • sky_engine 0.0.99
  • source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
  • sqflite_common 1.0.2+1 [synchronized path meta]
  • stack_trace 1.10.0-nullsafety.2 [path]
  • stream_channel 2.1.0-nullsafety.1 [async]
  • stream_transform 1.2.0
  • string_scanner 1.1.0-nullsafety.1 [charcode source_span]
  • synchronized 2.2.0+2
  • term_glyph 1.2.0-nullsafety.1
  • test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
  • typed_data 1.3.0-nullsafety.3 [collection]
  • uni_links 0.2.0 [flutter]
  • url_launcher_linux 0.0.1+1 [flutter]
  • url_launcher_macos 0.0.1+7 [flutter]
  • url_launcher_platform_interface 1.0.7 [flutter meta plugin_platform_interface]
  • url_launcher_web 0.1.2 [url_launcher_platform_interface platform_detect flutter flutter_web_plugins meta]
  • vector_math 2.1.0-nullsafety.3
  • xdg_directories 0.1.0 [path process flutter]
  • xml 4.2.0 [collection convert meta petitparser]```


crowd ios bug

Most helpful comment

I have the same issue. Using a iPhone XS. Modifying the action link in the template in Firebase Console changes what I receive in my email, but modifying actionCodeSettings doesn't. In fact, many fields of actionCodeSettings doesn't seem to have any impact (url, handleCodeInApp, dynamicLinkDomain). This is a fairly recent regression, it was working properly ~1-2 months ago.

All 4 comments

Hi @ibrahimbroachwala
Can you please provide a complete reproducible minimal code sample
Thank you

I have the same issue. Using a iPhone XS. Modifying the action link in the template in Firebase Console changes what I receive in my email, but modifying actionCodeSettings doesn't. In fact, many fields of actionCodeSettings doesn't seem to have any impact (url, handleCodeInApp, dynamicLinkDomain). This is a fairly recent regression, it was working properly ~1-2 months ago.

This now works for me as of firebase_auth: 0.18.1+2. The patch notes FIX: on iOS use sendEmailVerificationWithActionCodeSettings instead of sendEmailVerificationWithCompletion (#3686 ). Based on this, I think either this issue is a duplicate of #3571 or I commented on the wrong issue. Either way, happy it is fixed!

I tested in firebase_auth: 0.18.1+2 as @bkoznov mentioned. Its working fine on iOS now ๐Ÿ‘๐Ÿผ

However there is no sendEmailVerificationWithActionCodeSettings() method.

It works with this await user.sendEmailVerification(actionCodeSettings);

Thanks @bkoznov.
Closing this issue.

Was this page helpful?
0 / 5 - 0 ratings