Firebase Dynamic Links- Everything You Need to Know

Written by -Yash Nagda

10 Years back when we used to click on the link (given below). What would happen?

We simply go to a web page, complete our task and YAY !! But then the mobile phone happened and now when we click on any link we can go to a website or Android app or IOS app. To solve this problem and make our life easier here comes the deep link.

What is the deep link?

So, basically a deep link is the link that can redirect the user to an app or to some specific content in the app. For example, when you click on an advertisement of a sneaker on some website and when you click on that link, the product page opens in the Amazon app, it’s the magic of deep linking.

Problems with the deep link?

So there are number of problems with deep links.

  1. You need different links for IOS and Android app.
  2. No way to track how many people clicked the link and buy the product.
  3. What if user doesn’t have the app installed in their mobile phone.

To solve all these problems the Firebase dynamic links come into the play.

What is Firebase dynamic link?

To solve all the above problems, we can use firebase dynamic links. By using dynamic links we can specify different behavior for different platforms like IOS, Android or web and we can provide a fallback URL so if the user doesn’t have the app, he can install it from the store. The best thing is we can track all the clicks and conversion on the firebase console.

Configuring Android Project

So let’s get started, first we have to configure our android project and then we will create the dynamic links.

  1. Visit the
  2. Create a new project or click on an existing project
  3. Now we have to configure the project in our android app. There are 2 ways to do this either you can use built-in firebase assistant in android studio or setup manually by following this guide
  4. After this, you have to add firebase dynamic link dependency in app/build.gradle file
implementation ‘’

5. now we have to add intent filter to the activity which will receive and handle the dynamic link

<action android:name=”android.intent.action.VIEW”/>
<category android:name=”android.intent.category.DEFAULT”/>
<category android:name=”android.intent.category.BROWSABLE”/>

This intent filter allows our app to handle all the links that are from the domain name and the scheme is https.

Now our app is ready so it’s time to create the dynamic link and the simplest way to create them is by using the firebase console.

Creating our first dynamic link

1. Go to your firebase project and click on dynamic link on the right side and click on “New Dynamic Link” button.

2. Now choose default sub domain or add your own custom domain.

3. If everything goes right you will see this success dialog.

4. Now we have setup short link. You can enter any name according to your app.

5. You have to give a deep link URL. On desktop user will be redirected to this link. You can provide link to you website here or you can provide any old url.

6. Here define behaviour of the link on android or IOS app. Make sure the app is connected to the firebase project.

7. We will enter our dynamic link title,image, description to finish things off. You can also add UTM parameter if you want to track the campaign. As of now we will skip that.

8. YAY !! Our link is ready. To test it just copy the link and open it in your browser or send it to anyone on mail or WhatsApp.

Passing data with dynamic links

  1. In some cases, you need to pass data through your link as well. For example product id of shoe in our shiny shoe app. For this, you can add parameters directly in your link in the following way.

as you can see here we have added “shoeid” parameter in the link. Make sure that parameter is the deep link( and not in the dynamic link(

2 Now you can retrieve these parameters in the activity which is handling the links. (an activity with intent filter)

.addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
// Get deep link from result (may be null if no link is found)
Uri deepLink = null;
if (pendingDynamicLinkData != null) {
deepLink = pendingDynamicLinkData.getLink();
String shoeid=deepLink.getQueryParameter("shoeid");
.addOnFailureListener(this, new OnFailureListener() {
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "getDynamicLink:onFailure", e);

Here we have used getLink() method to get the link and getQueryParameter(your_param_name) to get the parameter from that link.


I hope you found this blog useful and learned how to use the firebase dynamic link. For more information, you can contact me on or you can drop your queries in the comment section below. I will be really glad to assist you.




🖋 Writer and Poet | 📙 Books | ✈ Travel | 🟡 Meditation

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CDRA Platforms: Best of Breed or All-in-One?

How We use Terraform Cloud

Coding Exercises != good interviews

[DOWNLOAD IN !PDF (SQL Server 2017 Integration Services Cookbook) ~*EPub]

How to host lightweight apps for free

Do You Need a Computer Science Degree to Be a Programmer?

Graph value based modeling


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yash Nagda

Yash Nagda

🖋 Writer and Poet | 📙 Books | ✈ Travel | 🟡 Meditation

More from Medium

How to Create a Firebase Authentication in Android studio.

Build monitoring system — part 1

What is Mobile Application Development?

Random wallpaper app