flutterfirebase-authenticationdeep-linkingfirebase-dynamic-linkspassword-less

Firebase Dynamic Links is deprecated and should not be used in new projects. Flutter alternative


I use dynamic links together with firebae auth email link. My app Flutter uses Passwordless Email Sign. I made the change in my project to use deeplink from my domain url. I made the adjustments to the specific Andorid and iOS files. .well-known folder configured correctly. The code snippet below is generating the email link with the url starting with the dynamic url 'page.link'. How do I make the url start with my domain's url and stop using dynamic links?

`await _auth.sendSignInLinkToEmail(
    email: email,
    actionCodeSettings: ActionCodeSettings(
      url: 'https://myurl.app?email=$email',
      handleCodeInApp: true,
      iOSBundleId: 'br.xx.yyy',
      androidPackageName: 'br.xx.zzz',
      androidInstallApp: true,
      androidMinimumVersion: "1.0.0",
    )

  )`

Url being generated email link: https://appxxx.page.link/?link=https://app-xx-xxxxx.firebaseapp.com/__/auth/action?apiKey%xxxxxxxxxxxg%26continueUrl%3Dhttps://myurl.app?email%253Demailxx@gmail.com%26lang%3Dpt-BR&apn=br.com.xxx.yyy&amv=1.0.0

Desired URL email link: https://myurl.app/?link=https://app-xx-xxxxx.firebaseapp.com/__/auth/action?apiKey%xxxxxxxxxxx%26continueUrl%3Dhttps://myurl.app?email%253Demailxx@gmail.com%26lang%3Dpt-BR&apn=br.com.xxx.yyy&amv=1.0.0


Solution

  • From the FAQ on the deprecation of Firebase Dynamic Links (emphasis mine):

    I only use Dynamic links for Firebase Authentication, will email link authentication in Firebase Authentication continue to work?

    Yes, your email link authentication using Firebase Authentication will continue to work.

    Firebase Authentication currently uses Firebase Dynamic Links to customize Authentication links, but we will provide an update to ensure that this functionality continues working after the Firebase Dynamic Links service is shut down.

    Note that this continuation of functionality is separate from using Firebase Dynamic Links for the primary use cases of store and web routing, deferred and regular deep-linking, which will be deprecated according to the migration timeline shared above.

    So Firebase will provide a replacement for its use of Dynamic Links in the email link authentication flow. There is nothing you need to do for that yourself right now.

    If you want to provide your own sign-in flow before Firebase provides a replacement that is possible too, but in that case you'll have to implement the entire sign-in flow yourself. There is no way to change the behavior of sendSignInLinkToEmail to work with that.