Skip to content

🐛 [firebase_ui_auth] "Magic Link" AuthStateChangeAction<SignedIn> not being fired #31

Closed as not planned
@FuadEfendi

Description

@FuadEfendi

Bug report

Describe the bug
Official example at firebase/flutterfire/packages/firebase_ui_auth/example/main.dart does not work: clicking the link in iPhone 14 Simulator "Safari" application accessing Gmail shows error message, and the callback AuthStateChangeAction not being fired

I am using updated "master" branch today, with all recent changes, but I initially noticed this issue weeks ago. Finally resolved by "workaround" (see below).

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to firebase/flutterfire/packages/firebase_ui_auth/example/main.dart
  2. add debug line 252 `print("successfully signed in");(see screenshot)
  3. run with iPhone 14 Pro iOS 16.2 simulator
  4. try to use "Sign in with magic link"
  5. Open "Safari", access GMail, click the link (see screenshot)
  6. Redirect error message in Safari (see screenshot)

Expected behavior

  1. After clicking Email "magic link" from the mobile device, Example application should automatically open and redirect to "/" route
  2. AuthStateChangeAction being fired
  3. Android Studio console should show debug message "successfully signed in"

Sample project

Official firebase/flutterfire/packages/firebase_ui_auth/example/main.dart with one-line debug message change (see attached)


Additional context

Note that I was able to fix this issue by workaround:
FirebaseAuth.instance.authStateChanges().listen((user) { if (FirebaseAuth.instance.currentUser != null) { Get.offAllNamed(HomeScreen.routeName); } });

  • and it works just perfect: clicking link from Safari's "GMail" will automatically open my application's "Home" screen.

Note also that example application will be already authenticated, but to find this you need to explicitly close it and open again.

Please provide also step-by-step guide on how to configure IOS and Android to make it work: <key>FirebaseDeepLinkPasteboardRetrievalEnabled</key> and etc.; it is not documented at all with the example application, including necessary Firebase "dynamic links", App Store, and other settings. README.md has only 17 lines but we need detailed step-by-step guide.

Thank you!

Simulator Screen Shot - iPhone 14 Pro - 2023-02-28 at 09 32 55

Simulator Screen Shot - iPhone 14 Pro - 2023-02-28 at 09 28 04

Screenshot 2023-02-28 at 9 56 00 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs AttentionOP created or responded to issue and it needs attention.StaleIssue with no recent activityauthplatform: iosIssues / PRs which are specifically for iOS.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions