Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Firebase_auth]: iOS sendSignInWithEmail requires dynamic links to be enabled #12666

Open
1 task done
benileo opened this issue Apr 17, 2024 · 4 comments
Open
1 task done
Assignees
Labels
blocked: firebase-sdk platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working

Comments

@benileo
Copy link

benileo commented Apr 17, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

I'm implementing sign in with email link without using dynamic links since they will be deprecated. I've setup universal and app links for both iOS and Android. The issue is that the firebase SDK considers it an internal error (only on iOS) if you haven't setup a dynamic link domain.

It works flawlessly on Android, however on iOS the call always fails. Why is a dynamic link domain required? Furthermore, even if I do enable a "dummy" dynamic link domain with a URL prefix it always strips out the /login part of the url. Pure wonkiness on the firebase side.

This is how I'm invoking the call:

FirebaseAuth.instance.sendSignInLinkToEmail(
  email: email,
  actionCodeSettings: ActionCodeSettings(
    url: "https://myappname.app/login",
    handleCodeInApp: true
));

This is how I'm completing the call with a deeplink in flutter, on iOS it never gets here. The email is never received or sent.

GoRoute(
  path: 'login',
  builder: (BuildContext context, GoRouterState state) {
    ... simplified snip ...
    var emailLink = "https://my-project-app.firebaseapp.com/__/auth/action?${state.uri.query}";
    await FirebaseAuth.instance.signInWithEmailLink(email: email, emailLink: emailLink);
  },
),

Reproducing the issue

Attempt to sendSignInWithEmail on iOS without dynamic links enabled.

Firebase Core version

2.27.0

Flutter Version

3.16.6

Relevant Log Output

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_auth/internal-error] An internal error has occurred, print and inspect the error details for more information.
#0      FirebaseAuthHostApi.sendSignInLinkToEmail (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:1299:7)
<asynchronous suspension>
#1      MethodChannelFirebaseAuth.sendSignInLinkToEmail (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:489:7)
<asynchronous suspension>
#2      FirebaseAuth.sendSignInLinkToEmail (package:firebase_auth/src/firebase_auth.dart:364:5)
<asynchronous suspension>

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.2.3
Flutter SDK 3.16.6
nextposture 1.0.0+6

dependencies:
- cloud_firestore 4.15.8 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- connectivity_plus 5.0.2 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm]
- cupertino_icons 1.0.8
- envied 0.5.4+1
- firebase_auth 4.17.8 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 2.27.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.4.18 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- fl_chart 0.64.0 [equatable flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine]
- flutter_local_notifications 16.3.3 [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 web]
- get_it 7.6.7 [async collection]
- go_router 13.2.4 [collection flutter flutter_web_plugins logging meta]
- google_fonts 5.1.0 [flutter http path_provider crypto]
- in_app_purchase 3.1.13 [flutter in_app_purchase_android in_app_purchase_platform_interface in_app_purchase_storekit]
- intl 0.18.1 [clock meta path]
- path 1.8.3
- shared_preferences 2.2.3 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- sqflite 2.3.2 [flutter sqflite_common path]
- uuid 3.0.7 [crypto]
- wakelock_plus 1.1.4 [flutter flutter_web_plugins meta wakelock_plus_platform_interface win32 dbus package_info_plus js]

dev dependencies:
- build_runner 2.4.9 [analyzer args async 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]
- envied_generator 0.5.4+1 [envied build code_builder dart_style source_gen analyzer recase equatable]
- flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_lints 2.0.3 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web]

transitive dependencies:
- _fe_analyzer_shared 64.0.0 [meta]
- _flutterfire_internals 1.3.25 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 6.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.4.10 [crypto path pointycastle]
- args 2.5.0
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.4.1 [analyzer async convert crypto glob logging meta package_config path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 7.3.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.9.2 [built_collection collection fixnum meta]
- characters 1.3.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- cli_util 0.4.1 [meta path]
- clock 1.1.1
- cloud_firestore_platform_interface 6.1.9 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.10.8 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 4.10.0 [built_collection built_value collection matcher meta]
- collection 1.18.0
- connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface]
- convert 3.1.1 [typed_data]
- crypto 3.0.3 [typed_data]
- dart_style 2.3.6 [analyzer args collection path pub_semver source_span]
- dbus 0.7.10 [args ffi meta xml]
- equatable 2.0.5 [collection meta]
- fake_async 1.3.1 [clock collection]
- ffi 2.1.0
- file 7.0.0 [meta path]
- firebase_auth_platform_interface 7.1.8 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.9.8 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta web]
- firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.11.5 [firebase_core_platform_interface flutter flutter_web_plugins js meta web]
- firebase_crashlytics_platform_interface 3.6.25 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- fixnum 1.1.0
- flutter_local_notifications_linux 4.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories]
- flutter_local_notifications_platform_interface 7.0.0+1 [flutter plugin_platform_interface]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web]
- frontend_server_client 4.0.0 [async path]
- glob 2.1.2 [async collection file path string_scanner]
- graphs 2.3.1 [collection]
- http 1.2.0 [async http_parser meta web]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image 4.1.7 [archive meta xml]
- in_app_purchase_android 0.3.3+1 [collection flutter in_app_purchase_platform_interface json_annotation]
- in_app_purchase_platform_interface 1.4.0 [flutter plugin_platform_interface]
- in_app_purchase_storekit 0.3.13+1 [collection flutter in_app_purchase_platform_interface json_annotation]
- io 1.0.4 [meta path string_scanner]
- js 0.6.7 [meta]
- json_annotation 4.8.1 [meta]
- lints 2.1.1
- logging 1.2.0
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.5.0 [collection]
- meta 1.10.0
- mime 1.0.5
- nm 0.5.0 [dbus]
- package_config 2.1.0 [path]
- package_info_plus 5.0.1 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32]
- package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- path_provider 2.1.3 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- path_provider_android 2.2.4 [flutter path_provider_platform_interface]
- path_provider_foundation 2.3.2 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
- path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32]
- petitparser 6.0.2 [meta]
- platform 3.1.4
- plugin_platform_interface 2.1.8 [meta]
- pointycastle 3.8.0 [collection convert js]
- pool 1.5.1 [async stack_trace]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- recase 4.1.0
- shared_preferences_android 2.2.2 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.3.5 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.3.2 [flutter plugin_platform_interface]
- shared_preferences_web 2.2.2 [flutter flutter_web_plugins shared_preferences_platform_interface web]
- shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml]
- source_span 1.10.0 [collection path term_glyph]
- sqflite_common 2.5.3 [synchronized path meta]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- synchronized 3.1.0+1
- term_glyph 1.2.1
- test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- timezone 0.9.2 [path]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- vector_math 2.1.4
- wakelock_plus_platform_interface 1.1.0 [flutter plugin_platform_interface meta]
- watcher 1.1.0 [async path]
- web 0.3.0
- web_socket_channel 2.4.0 [async crypto stream_channel]
- win32 5.2.0 [ffi]
- xdg_directories 1.0.4 [meta path]
- xml 6.5.0 [collection meta petitparser]
- yaml 3.1.2 [collection source_span string_scanner]

Additional context and comments

No response

@benileo benileo added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Apr 17, 2024
@benileo benileo changed the title [Firebase_auth]: iOS sendSIgnInWithEmail requires dynamic links to be enabled [Firebase_auth]: iOS sendSignInWithEmail requires dynamic links to be enabled Apr 17, 2024
@TarekkMA TarekkMA added plugin: auth platform: ios Issues / PRs which are specifically for iOS. labels Apr 18, 2024
@TarekkMA TarekkMA self-assigned this Apr 18, 2024
@TarekkMA
Copy link
Contributor

Hello @benileo,

Thanks for pointing out this issue! Please upgrade your dependencies, clean the project, and try again. Let us know if that fixes the problem!

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Apr 18, 2024
@benileo
Copy link
Author

benileo commented Apr 18, 2024

It did not fix the issue.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Apr 18, 2024
@TarekkMA
Copy link
Contributor

Hey @benileo,

I was able to replicate the issue. The underlying error is: FDL Domain is not configured. I'll be working on fixing this error message to make it clearer. In the meantime, can you have a look at this link Firebase App Linking Guide? If that doesn't resolve the issue, please open an issue on the Firebase iOS SDK GitHub repository since the error message is coming from the native side, and the Firebase team should be able to provide more information.

@benileo
Copy link
Author

benileo commented Apr 19, 2024

@TarekkMA I've went through Firebase App Linking Guide already and I've replaced all the dynamic links with Universal and App Links. It does not resolve the issue because the issue is with Firebase iOS SDK. Why is dynamic link domain required? Doesn't make sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: firebase-sdk platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants