DEV Community

akram chorfi
akram chorfi

Posted on

Firebase Dynamic Links is being deprecated – here’s how I use LinkHive with Flutter

I wanted deep links in my Flutter app – links that could take users straight to the right screen, even after they installed or reinstalled the app.

That’s why I built LinkHive – a Firebase Dynamic Links alternative with a Flutter SDK that lets you create, update, fetch, delete, and handle deferred links all in one place. It’s simple, predictable, and works across Web, iOS, and Android.

In this post, I’ll show you how to get it running and start generating dynamic links in minutes.

Before we dive into the SDK, let’s get your platforms set up.

Setting up LinkHive on all platforms 🌐📱
1️⃣ Web

No setup needed!

Go to your Admin Dashboard

Create a Web platform entry

Start generating dynamic links that work in all browsers immediately

2️⃣ iOS

To make Universal Links work:

Add your app’s Associated Domains entitlement with your LinkHive domain:

applinks:xxx.linkhive.tech
Enter fullscreen mode Exit fullscreen mode

or your branded custom domain.

LinkHive automatically hosts and updates the apple-app-site-association file.

In your Admin Dashboard:

Add a new iOS platform

Enter your Bundle ID and Team ID

⚠️ Apple may take up to 24 hours to recognize the file.

Once done, dynamic links open your app seamlessly on iOS.

3️⃣ Android

Update your AndroidManifest.xml

Add this inside the activity that handles the links:

<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="xxx.linkhive.tech" />
</intent-filter>

<meta-data android:name="flutter_deeplinking_enabled" android:value="false"/>
Enter fullscreen mode Exit fullscreen mode

LinkHive automatically hosts your assetlinks.json file for domain verification.

In your Admin Dashboard:

Add a new Android platform

Enter your Package Name and SHA-256 Certificate Fingerprint

✅ Domain verification is usually instant.

Test it

adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://subdomain.linkhive.tech/shortCode"

If everything is configured, the link opens directly in your app.

🚀 After setup

Once your app is registered and the platform configs are done, LinkHive handles all routing and link resolution automatically.

No extra dependencies are required, and the Flutter SDK gives you full control over dynamic link features.

Using the Flutter SDK

Once your platforms are ready, the SDK lets you create, fetch, update, delete, and handle deferred links in Flutter.

Connect to the LinkHive API


import 'package:link_hive_flutter/link_hive_flutter.dart';

await LinkHiveClient.instance.connect(
  baseUrl: 'YOUR_BASE_URL_HERE',
  projectId: 'YOUR_PROJECT_ID_HERE',
  clientId: 'YOUR_CLIENT_ID_HERE',
);
Enter fullscreen mode Exit fullscreen mode

Create a Dynamic Link

final request = DynamicLinkRequest(
  platformIds: {
    '123e4567-e89b-12d3-a456-426614174000',
    '987e4567-e89b-12d3-a456-426614174001'
  },
  utm_medium: 'twitter',
);

final dynamicLink = await LinkHiveClient.instance.dynamicLinks.create(request);
print('Created dynamic link: $dynamicLink');
Enter fullscreen mode Exit fullscreen mode

Update a Link

final updatedLink = await LinkHiveClient.instance.dynamicLinks.update(
  'linkId', 
  request,
);
print('Updated dynamic link: $updatedLink');
Enter fullscreen mode Exit fullscreen mode

Fetch Links

final linkById = await LinkHiveClient.instance.dynamicLinks.getById('linkId');
print('Fetched by ID: $linkById');

final linkByShortCode = await LinkHiveClient.instance.dynamicLinks.getByShortCode('shortCode');
print('Fetched by short code: $linkByShortCode');
Enter fullscreen mode Exit fullscreen mode

Delete a Link

await LinkHiveClient.instance.dynamicLinks.delete('linkId');
print('Dynamic link deleted.');
Enter fullscreen mode Exit fullscreen mode

Deferred Links (After App Install)

final deferredLink = await LinkHiveClient.instance.dynamicLinks.getDeferredLink();
if (deferredLink != null) {
  print('Deferred link: $deferredLink');
} else {
  print('No deferred link found');
}
Enter fullscreen mode Exit fullscreen mode

Handling Links While App is Running

final initialLink = await LinkHiveClient.instance.dynamicLinks.getInitialLink();
print(initialLink ?? 'No initial link');

LinkHiveClient.instance.dynamicLinks.onLinkReceived.listen((link) {
  print('Received dynamic link: $link');
});
Enter fullscreen mode Exit fullscreen mode

Errors

The SDK throws:

NotFoundException → resource not found

ApiException → API error

NetworkException → network issue

Wrap-up

LinkHive makes deep linking in Flutter way simpler than Firebase Dynamic Links.

You get:

Easy dynamic link creation, update, fetch, delete

Deferred link support

iOS & Android handling with minimal setup

Fully working Flutter SDK

Check it out:

GitHub: https://github.com/LinkHiveTech/linkhive_flutter

Docs: https://docs.linkhive.tech

Top comments (0)