skip to Main Content

We can send out an email verification like the code below. I want the deep link specified to open. I can confirm that this deep link works on iOS. If I run this in the terminal, the app opens correctly.

xcrun simctl openurl booted customscheme://[LINKDOMAIN].page.link/

user.sendEmailVerification(
        ActionCodeSettings(
          url: 'customscheme://[LINKDOMAIN].page.link/',
          handleCodeInApp: true,
          iOSBundleId: '[BUNDLE]',
          androidPackageName: '[PACKAGE]',
          androidInstallApp: true,
          androidMinimumVersion: '12',
        ),
      );

This shoots an email to the user with a link. The link is very long and complicated. When you click the link, it will verify the email address, but it won’t open the deep link. I get this error:

enter image description here

Error encountered
This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.

The error is coming from Firebase. I don’t think it wants to let me send a deep link via email. I think it wants me to use Firebase’s dynamic linking system. This may be true, but I don’t think I need it for this simple scenario. I just need to open the app. I don’t need to pass any parameters. Why is it stopping me from just opening a simple deep link?

Do I need to use Firebase’s full-fledged dynamic linking system and use the Flutter SDK for that?

Edit: I set the handleCodeInApp to false, and I’m now a step closer on Android. The link verifies the email, but it doesn’t open the deep link in the app. It should open it because if I punch the Url into the browser, the app opens. This is what happens.

To put this another way, the dynamic link works fine, but the link that Firebase is sending out by email is not redirecting to the correct dynamic link.

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    It seems to be working on Android. The part I missed was adding the SHA1 fingerprint for the Android app. I still need to get iOS working.


  2. The documentation says:

    To learn more on how to handle sign-in with email link in an Android application, refer to the Android guide.

    To learn how to more on how to handle sign-in with email link in an Apple application, refer to the Apple platforms guide.

    Specific details are provided at those addresses.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search