Ad

Understand Dynamic Links Firebase

I would like to understand better Firebase Dynamic Links because i am very new to this subject.

What i would like to know :

  • FirebaseDynamicLinks.instance.getInitialLink() is supposed to return "only" the last dynamic link created with the "initial" url (before it was shorten) ?

  • Or why FirebaseDynamicLinks.instance.getInitialLink() doesn't take a String url as a parameter ?

  • FirebaseDynamicLinks.instance.getDynamicLink(String url) doesn't read custom parameters if the url was shorten, so how can we retrieve custom parameters from a shorten link ?

My use case is quite simple, i am trying to share an object through messages in my application, so i want to save the dynamic link in my database and be able to read it to run a query according to specific parameters.

Ad

Answer

  1. FirebaseDynamicLinks.instance.getInitialLink() returns the link that opened the app and if the app was not opened by a dynamic link, then it will return null.

    Future<PendingDynamicLinkData?> getInitialLink()

    Attempts to retrieve the dynamic link which launched the app.

    This method always returns a Future. That Future completes to null if there is no pending dynamic link or any call to this method after the the first attempt.

    https://pub.dev/documentation/firebase_dynamic_links/latest/firebase_dynamic_links/FirebaseDynamicLinks/getInitialLink.html

  2. FirebaseDynamicLinks.instance.getInitialLink() does not accept a string url as parameter because it is just meant to return the link that opened the app.

  3. Looks like there's no straightforward answer to getting the query parameters back from a shortened link. Take a look at this discussion to see if any of the workarounds fit your use case.

Ad
source: stackoverflow.com
Ad