Firebase Dynamic Links — An alternative

Firebase Dynamic Links are going away, and your clock is ticking! Before it gets too late, you must switch to a new solution… or, create your solution! Let’s see how you can make a solution for deep links!

Abhishek Doshi
Google Developer Experts
4 min readJan 4, 2025

--

Deep Linking allows us to provide custom flow to our users. Deep linking enables apps to respond to URLs and navigate users to specific pages or perform actions. Till now, Firebase Dynamic Links was a prominent solution for this feature. However, Firebase has decided to stop the support of Dynamic Links and the service will shut down on August 25, 2025 (Reference). And now, the clock is ticking, and we need to either migrate to a new solution or use a custom one.

There are lots of solutions available like Apps Flyer, One Link, etc. But all solutions have some or other things and if you just need a simple deep link that allows you to show custom views in your app based on the URL & parameters, then these solutions are not ideal (probably paid as well).

So, if you are a developer, why not create your solution? It is much easier and faster to create your solution rather than integrating and trying out different solutions. Let’s see how you can do that!

Step 0: Create a website

Well, all deep links have a website, or you can say a URL. In our case, we need to just create a website that will be a simple view. This website will be visible if the user has not installed your app. Hence, you can add logic to open respective stores so that users can download the app.

Let’s suppose you create a website https://abc.com. It’s not required to have a .com domain or any paid domain, you can also host the website on any free hosting services like Firebase Hosting, Netlify, etc.

Step 1: Configuration Files on your website

Once your website is ready, we need to create 2 files each for Android and iOS. In your website’s codebase, you need to create a folder called .well-known which will contain the configuration files. Do not change the name of the folder!

Android

Inside your .well-known folder, create a new file called assetlinks.json
This file will contain the configurations for your Android app. It should contain the following content:

[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.example.app",
"sha256_cert_fingerprints": [
"your sha256 key"
]
}
}
]

In the above file, you need to swap the package_name to your app’s package name and add SHA256 key in the list. You can add your device’s SHA256 key to help you debug it (optional) and add the SHA256 key that you used to sign your app while releasing. Or, if you sign your production app via Google Play Store, you can find it in the Developer Console at Setup > App Integrity > App Signing.

iOS

Inside your .well-known folder, create a new file called apple-app-site-association. This file will contain the configurations for your iOS app. It should contain the following content:

{
"applinks": {
"apps": [],
"details": [
{
"appIDs": [
"teamID.bundleID"
],
"components": [
{
"/": "*",
"comment": "Matches any URL path"
}
]
}
]
}
}

In the above file, you need to swap teamID to your app’s Team ID (you can get it from Xcode or Apple Developer Console) and bundleID to your app’s Bundle ID. In thecomponents, you can add either all URLs by providing * or you can mention specific paths.

Once these files are added, deploy it again and verify that you can see the updated files at https://abc.com/.well-known/apple-app-site-association and https://abc.com//.well-known/assetlinks.json. If you don’t see the updated content, refresh the cache or wait for some time.

Step 2: App Configuration

Once your website configuration is completed, now it’s time to configure our app to handle the deep links.

Android

To support deep links on Android, let’s edit AndroidManifest.xml file. Add the following to your file:

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="yourDomain.com" />
</intent-filter>

Don’t forget to update the domain (in our example, it would be abc.com). The above example will open your app for any path of your website. If you wish to only open the app for specific paths, you can do something as follows:

<data android:path="/invite" />  

This will open the app only if the deep link is https://abc.com/invite

iOS

To accept deep links in iOS, you need to open Xcode and in Signing & Capabilities you need to add your domain to Associated Domains

That’s it, iOS configuration is not that difficult.

Step 3: Handling Deep Links

Now that all configurations are done, we need to handle the deep links in our app. You can use a package like app_links that helps you quickly and easily handle the deep link. To handle deep links using the app_links package, you need to do the following:

final appLinks = AppLinks(); // AppLinks is singleton

// Subscribe to all events (initial link and further)
final sub = appLinks.uriLinkStream.listen((uri) {
// Do something (navigation, ...)
});

That’s it! It’s so easy to create your custom deep-linking solution and with this, you won’t have to pay or try different solution providers.

Hope you enjoyed this article!

Doubts? Feel free to drop a message @AbhishekDoshi26
Checkout abhishekdoshi.dev for more info 💙

Don’t stop, until you are breathing!💙
- Abhishek Doshi

--

--

Abhishek Doshi
Abhishek Doshi

Written by Abhishek Doshi

Google Developer Expert — Dart, Flutter & Firebase 💙💛

No responses yet