ChottuLink for Flutter
ChottuLink is the best deep linking solution for Flutter, offering a drop-in replacement for Firebase Dynamic Links with zero complexity.
It comes with a lightweight Flutter SDK and supports:
- Universal Deep Links β Open your app from any platform with a single link
- Deferred Deep Links β Redirect users to the right content even after app install
- Branded Short Links β Create shareable, professional links with your own branding
- Advanced Analytics β Track user behavior, clicks, and conversions with ease
ChottuLink ensures fast integration, high performance, and seamless user experiences, making it the #1 choice for Flutter developers.
Why Choose ChottuLink ?
- π Drop-in Replacement for Firebase Dynamic Links β Easy migration, no complexity.
- π± One Link for Both App Stores β Works for Apple App Store & Google Play Store.
- π― Universal & Deferred Deep Links β Seamless routing even after app install.
- π Branded Short Links β Strengthen your brand identity with custom domains.
- π Advanced Analytics β Track clicks, installs, and conversions effortlessly.
- π Lightweight Flutter SDK β Minimal size, simple integration, fast performance.
Key Benefits
- β Flutter-only SDK β Lightweight & fast.
- β Simple migration from Firebase Dynamic Links.
- β One link for all stores, all platforms.
- β Built-in analytics for real-time tracking.
π Prerequisites
Before integrating ChottuLink into your iOS app, ensure you have the following:
Development Environment
- Flutter SDK installed (Flutter
v3.3.0or later recommended) - Dart SDK installed (Dart
v3.5.0or later recommended) - A working Flutter project targeting iOS
15.0+and Android5.0+ (API 21+) - Xcode
16.2or later installed (for iOS) - Android Studio or other IDE with Android SDK installed
- Physical devices or simulators/emulators to run your app
- Git for version control
π§ Configure ChottuLink Dashboard
1. For iOS - Click here
2. For Android - Click here
π¦ Installation
1. Add the ChottuLink SDK to your Flutter project:
dependencies:
flutter:
sdk: flutter
chottu_link: ^latest_version
Click here to get the latest version.
2. Then run:
flutter pub get
π±Platform Specific Configurations
1. For iOS - Click here
2. For Android - Click here
Remember to change:
yourapp.chottu.link to the domain you've set up on ChottuLink Dashboard for your app's links.
π Initialize the ChottuLink SDK
Note: You can get the mobile SDK API KEY from ChottuLink Dashboard API Keys section
Initialize the SDK in main.dart:
import 'package:chottu_link/chottu_link.dart';
void main() async {
/// β οΈ Make sure to call this before call ChottuLink.init(apiKey: "your_api_key_here").
WidgetsFlutterBinding.ensureInitialized();
/// β
Initialize the ChottuLink SDK
/// Make sure to call this before using any ChottuLink features.
await ChottuLink.init(apiKey: "your_api_key_here");
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter ChottuLink Demo',
home: HomeScreen(),
);
}
}
π¦ Generate Dynamic Links in Flutter
This guide covers how to create a Dynamic Link directly from your Flutter app using Dart.
π Build a Dynamic Link
/// β
Import ChottuLink SDK packages
import 'package:chottu_link/chottu_link.dart';
import 'package:chottu_link/dynamic_link/cl_dynamic_link_behaviour.dart';
import 'package:chottu_link/dynamic_link/cl_dynamic_link_parameters.dart';
/// Create dynamic link parameters
final parameters = CLDynamicLinkParameters(
link: Uri.parse("https://example.com"), // Target deep link
domain: "yourapp.chottu.link", // Your ChottuLink domain
// Set behavior for Android & iOS
androidBehaviour: CLDynamicLinkBehaviour.app,
iosBehaviour: CLDynamicLinkBehaviour.app,
// UTM Tracking (for analytics)
utmCampaign: "exampleCampaign",
utmMedium: "exampleMedium",
utmSource: "exampleSource",
utmContent: "exampleContent",
utmTerm: "exampleTerm",
// Optional metadata
linkName: "linkname",
selectedPath: "customPath",
socialTitle: "Social Title",
socialDescription: "Description to show when shared",
socialImageUrl: "https://yourdomain.com/image.png", // Must be a valid image URL
);
𧬠Create the Link
ChottuLink.createDynamicLink(
parameters: parameters,
onSuccess: (link) {
debugPrint("β
Shared Link: $link"); // π Successfully created link
},
onError: (error) {
debugPrint("β Error creating link: ${error.description}");
},
);
- Default behavior is set to
.appfor both platforms selectedPathis optional - if not provided, a random path will be generatedSocialParametersis optional - enhances link previews when sharedUTMParametersis optional - helps track campaign performance
π¦ Handle Dynamic Links in Flutter
Enable your Flutter app to receive and handle ChottuLinks seamlessly. This allows users to open specific screens when they tap a dynamic link, whether the app is running, in the background, or launched from a cold start. Integrate link handling to ensure a smooth and context-aware user experience across platforms.
π§ Implementation Guide
/// β
Import ChottuLink SDK packages
import 'package:flutter/material.dart';
import 'package:chottulink_flutter_sdk/chottulink_flutter_sdk.dart';
/// π Listen for incoming dynamic links
ChottuLink.onLinkReceived.listen((String link) {
debugPrint(" β
Link Received: $link");
/// Tip: β‘οΈ Navigate to a specific page or take action based on the link
});
(Optional) Get AppLink Data from the Deeplink URL directly
URL Processing
Process the shortened Deeplink using the getAppLinkDataFromUrl method.
This retrieves the associated app link data and returns a ResolvedLink object containing the resolved destination URL and the original short link.
π Method Signature
New Feature
This method was introduced in SDK version v1.0.9+
static Future<void> getAppLinkDataFromUrl({
required String shortUrl,
void Function(ResolvedLink resolvedLink)? onSuccess,
void Function(ChottuLinkError error)? onError,
});
Parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
| shortUrl | String | β Yes | The shortened URL string to be resolved |
| onSuccess | Function(ResolvedLink resolvedLink) | No | Called on successful link resolve |
| onError | Function(ChottuLinkError error) | No | Called if link resolve fails |
π€ Return Value
class ResolvedLink {
String? link;
String? shortLink;
ResolvedLink({this.link, this.shortLink});
}
π» Basic Implementation
ChottuLink.getAppLinkDataFromUrl(
shortUrl: "https://yourApp.chottu.link/xxxxxx",
onSuccess: (resolvedLink) {
print("β
Link: ${resolvedLink.link}");
print("β
Short Link: ${resolvedLink.shortLink}");
},
onError: (error) {
print("β Error: ${error.message}");
},
);