I appreciate the Dynamic Links are deprecated and will stop working in August 2025, but they still provide us with a very useful ability to survive the app install (which we use to attribute/value and auto-login users from external partners). Deep links are also useful for the app we have made.
The problem I am having is that when I get an incoming dynamic link (which also happens to be a passwordless email login link) which is handled as documented here and here, I am also seeing an incoming dynamic link and the router tries to handle this which is producing some problems, as mentioned in this bug report. (in particular, we end up with the listener attempting to authenticate the user whilst the router is trying to route the link)
What I cannot determine from the documentation of either Dynamic links or Deep links is what is the prescribed way to deal with this scenario until Dynamic links stop functioning.
If I knew that I could always get the dynamic link via the router as reliably as I can via the listener (FirebaseDynamicLinks.instance.onLink.listen
as in the documented usage example), then I presume I can simply stop listening and only rely on the router for my dynamic links.
For example, for passwordless login links which we use, I could check the routeSettings.name
in my onGenerateRoutes
using FirebaseAuth.instance.isSignInWithEmailLink
and redirect to the appropriate view to handle the email login? I presume I would still need to check the FirebaseDynamicLinks.instance.getInitialLink()
as well, though?
Is there a way that works reliably for the next 18 months or so as we work out which of the many options to replace Dynamic links is the best?
Right now, to stop processing twice, and given that the documented way is still to use the stream listener, I am doing this in my onGenerateRoute
(which is pretty hacky, so would prefer a better option!)
// Ignore the action links from the email verification as they are handled by the dynamic links
if (routeSettings.name?.startsWith("/__/auth/action") ?? false)
{
return null;
}