Firebase Dynamic Links is a Google service for creating smart links that direct users to the right place in an app regardless of whether the app is installed or not. According to Firebase Documentation, Dynamic Links automatically redirect users to the App Store or Google Play if the app is not installed and restore the transition context after installation. Firebase Smart Links solve the URL Scheme problem, which does not work with uninstalled apps.
Key Takeaways
Firebase Dynamic Links is a cloud service from Google that creates unified universal links for mobile apps on iOS and Android. A dynamic link contains a deep link to content inside the app but behaves like a regular HTTPS link: if the app is installed, it opens it directly; if not, it redirects to the app store.
Unlike regular URL Schemes, Dynamic Links can work with uninstalled apps thanks to deferred deep link technology. When a user installs the app after clicking the link, Firebase saves the transition parameters and passes them on the first launch. This opens up opportunities for referral programs, marketing campaigns, and invitations.
URL Schemes require the app to be installed and have no standard fallback mechanism. Firebase Dynamic Links solve this problem through an intermediate Firebase web service that determines the app installation status on the device and routes the user correctly. At the same time, one link works identically on both platforms.
Firebase Dynamic Link uses a domain like yourcode.page.link, which is registered in Firebase Console. When a user clicks such a link, Firebase determines the device type and app installation status. For iOS, the Universal Links mechanism is used; for Android, App Links with automatic verification via Digital Asset Links.
The processing flow includes several sequential stages: when the link is clicked, the browser sends a GET request to the Firebase server; the server determines the platform and checks for the app on the device. If the app is installed, a redirect is generated to a Universal Link or Intent with parameters to open the target screen. If the app is not installed, it redirects to the App Store or Google Play for download.
The app receives the link during Firebase SDK initialization. The getDynamicLink() method returns a PendingResult with transition data. After successful retrieval, the deep link parameters, UTM tags for analytics, and arbitrary data passed when creating the link are extracted.
Firebase Console provides a visual interface for creating Dynamic Links. The developer specifies the deep link URL, campaign name, settings for iOS and Android separately, and analytics parameters. After creation, Firebase generates a short link like https://yourcode.page.link/abc123, which can be used in advertising materials, email campaigns, and social networks.
For programmatic creation of Dynamic Links, the Firebase REST API or client SDK is used. The REST API allows bulk link generation for marketing campaigns with custom parameters, including social network links and asynchronous click analytics. When creating links via the API, it is important to correctly specify the socialMetaTagInfo parameters — they determine how the link appears when shared in messengers and social networks with a preview card.
| Parameter | Purpose | Required |
|---|---|---|
| Deep Link URL | Internal link to app content | Yes |
| iOS Bundle ID | App identifier in the App Store | For iOS |
| Android Package Name | Package name in Google Play | For Android |
| Fallback URL | Web page if the app is not installed | No |
| UTM Tags | Parameters for Google Analytics | No |
To work with Firebase Dynamic Links on iOS, you need to integrate the Firebase SDK via CocoaPods or Swift Package Manager, configure Info.plist with GOOGLE_APP_ID, and register the Dynamic Links domain in the project’s Associated Domains. After that, the app automatically handles Universal Links generated by Firebase.
In Xcode, you need to add the Associated Domains capability with an entry like applinks:yourcode.page.link. The Firebase SDK uses the application(_:continue:restorationHandler:) method to handle Universal Links, so no additional integration with AppDelegate is required — Firebase automatically extracts Dynamic Link parameters from User Activity.
Example of Info.plist configuration for proper Firebase initialization and Dynamic Link handler registration. The FIROptions key should contain the project identifier from GoogleService-Info.plist.
<key>FirebaseDynamicLinksCustomDomains</key>
<array>
<string>https://yourcode.page.link</string>
</array>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
If the AppDelegate proxy is disabled, you must manually call the handleUniversalLink(_:) method and pass the User Activity from the continue NSUserActivity. The Firebase SDK automatically extracts the link parameters and returns a DynamicLink via the completion handler.
On Android, Firebase Dynamic Links integration starts with adding dependencies to build.gradle and the google-services.json file from Firebase Console. The Dynamic Links domain is registered in Firebase Console, after which all links with this domain are automatically recognized by the Android app via an Intent Filter with action VIEW. For proper operation, you also need to add the Google Services plugin to the root and module build.gradle and perform Gradle synchronization.
To correctly handle links on Android, you need to add an Intent Filter for the Dynamic Links domain in the Activity that should receive incoming links. The filter must include the https scheme, your Dynamic Links domain host, and the default path.
Example of Intent Filter in AndroidManifest.xml for receiving Dynamic Links on the yourcode.page.link domain.
<activity android:name=".MainActivity"
android:launchMode="singleTask">
<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"
android:host="yourcode.page.link" />
</intent-filter>
</activity>
It is important to set launchMode to singleTask for the Activity that receives Dynamic Links. This prevents creating a new instance of the Activity on repeated link clicks and allows handling all incoming deep links in a single instance.
The Firebase SDK for Android provides the FirebaseDynamicLinks.getInstance().getDynamicLink(intent) method, which returns a PendingTask object with link data. The deep URI, UTM parameters, and transition timestamp are extracted from the DynamicLink object. It is recommended to handle this in the onCreate() and onNewIntent() methods of the Activity.
When handling, it is important to consider that a Dynamic Link can be received both when launching the app from a cold start and when transitioning from another app to an already running app. For the second case, you need to override onNewIntent() and re-call the Dynamic Link check.
Example of receiving and handling a Firebase Dynamic Link in MainActivity. The code handles both cold start and transition from another app.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
checkDynamicLink(intent)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
checkDynamicLink(intent)
}
private fun checkDynamicLink(intent: Intent) {
FirebaseDynamicLinks.getInstance()
.getDynamicLink(intent)
.addOnSuccessListener link ->
val deepLink = link?.link.toString()
handleDeepLink(deepLink)
}
}
}
The addOnSuccessListener method returns a DynamicLink, from which the target link is extracted via link?.link. If the listener returns null, it means the Intent does not contain a Dynamic Link — this is a normal app launch without an incoming link. UTM tags for click analytics are also available, including campaign, medium, source, and content, which can be passed to Google Analytics for detailed evaluation of each marketing channel’s effectiveness.
Frequently Asked Questions
Firebase Dynamic Links supports deferred deep link — the link preserves the context even if the app is not installed. After installation, the app receives all the transition parameters, which is impossible with regular URL Schemes or Universal Links.
Firebase Dynamic Links are included in the free Firebase Spark pricing plan. There are no limits on the number of links you can create. However, since 2024 Google has announced a transition to a new infrastructure, so the terms may change.
Dynamic Links are designed for mobile apps. When clicking the link from a desktop web browser, it will open the fallback URL. For web apps, use regular links or your own redirect logic.
Firebase Console provides a Test Dynamic Link button for previewing behavior. You can also use the Android emulator or iOS simulator with the Firebase SDK installed for local testing of all transition scenarios.
A short Firebase Dynamic Link consists of the page.link domain and a random suffix about 7 characters long. The total length is approximately 30 characters. The deep link inside can be any length, but it is recommended to keep it under 2 KB for compatibility.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also