Search code examples
androidandroid-studiodeep-linkingfirebase-dynamic-links

What happens if I don't receive dynamicLink with getDynamicLink(intent)?


According to documentation

You must call getDynamicLink() in every activity that might be launched by the link, even though the link might be available from the intent using getIntent().getData().

So I already have an deepLink intent handler that every time I receive a dynamic link it gets the deepLink and handles it using intent.data, I know it provides assistance in removing the dynamicLink from memory but aside from that does it improve functionality in any way? Thanks in advance.


Solution

  • getDynamicLink() can be used to validate that the app has been launched by a Dynamic Link, and not through some link that the app's Intent can receive.

    It also has a function that can fetch custom parameters added in the deep link. This can be done by calling pendingDynamicLinkData.link.getQueryParameter(String) as demonstrated here.