Skip to main content
SDK Version Selection

Choose your SDK version below:

  • Apptrove SDK → Recommended for all projects (Latest: v2.0.0)
  • Trackier SDK → Will be deprecated in May 2026 (v1.x.xx)

Use the tabs below to view deep linking code for your chosen SDK.

Overview

This guide provides detailed instructions for implementing deep linking with the Apptrove Flutter SDK. Deep linking enhances user engagement by redirecting users to specific in-app content, supporting both normal and deferred deep linking for Android and iOS platforms.

Prerequisites

  • A Flutter application with the Apptrove SDK installed and initialized
  • Access to the Apptrove Panel for configuring deep link URLs
  • Flutter 2.0 or later, Dart 2.12 or later
  • Basic knowledge of Dart, Flutter, and native platform configurations (AndroidManifest.xml, Info.plist)

Deep Linking

Deep linking allows users to navigate directly to specific content within your app using URLs (e.g., https://trackier.u9ilnk.me). The Apptrove SDK supports two types of deep linking:

  • Normal Deep Linking: Redirects users to specific app content if the app is already installed.
  • Deferred Deep Linking: Redirects users to the app store for installation, then to specific content upon first app open after installation.

Normal Deep Linking

Normal deep linking opens the app directly when a user clicks a deep link, provided the app is installed. Configure your app to handle these links by updating the native platform configurations.

Android Configuration

Add an activity to handle deep links in your android/app/src/main/AndroidManifest.xml file.

AndroidManifest.xml Example
<activity
android:name=".Activity.FirstProduct"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="trackier.u9ilnk.me"
android:pathPrefix="/product"
android:scheme="https" />
</intent-filter>
</activity>

Example URL: https://trackier.u9ilnk.me/product?dlv=FirstProduct&quantity=10&pid=sms

This configuration ensures that clicking the deep link opens the FirstProduct activity with the specified parameters.

iOS Configuration

For iOS, configure a URL scheme or universal link in ios/Runner/Info.plist to handle deep links.

Info.plist Example for URL Scheme
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>trackier</string>
</array>
</dict>
</array>

For universal links, host an apple-app-site-association file on your domain (e.g., trackier.u9ilnk.me/.well-known/apple-app-site-association) and enable the Associated Domains capability in Xcode.

  1. In Xcode, select your project and target.
  2. Go to the Capabilities tab.
  3. Enable Associated Domains.
  4. Add applinks:trackier.u9ilnk.me to the domains list.

Ensure Apptrove hosts the apple-app-site-association file for your domain to support universal links.

Fallback Issue Fix

If clicking a deep link opens your app but then immediately redirects to the App Store, add the following key to your ios/Runner/Info.plist file:

<key>FlutterDeepLinkingEnabled</key>
<string>false</string>

This disables Flutter's default deep linking handling and allows the Apptrove SDK to properly process the deep links.

Deferred Deep Linking

Deferred deep linking handles cases where the app is not installed. When a user clicks a Apptrove URL, they are redirected to the app store (Google Play or App Store) to install the app. After installation and first app open, the SDK processes the deep link to route the user to the specified content.

Configure the SDK to handle deferred deep links by setting a callback during initialization.

main.dart
void initDeepLinkListener() {
uriLinkStream.listen((Uri? uri) {
if (uri != null) {
AppTroveFlutterSdk.parseDeeplink(uri.toString());
}
}, onError: (err) {});
}
main.dart
import 'package:apptrove_sdk_flutter/apptrove_sdk_flutter.dart';

// In initPlatformState():
AppTroveSDKConfig config = AppTroveSDKConfig("xxxx-xxxx-xxxx-xxxx-xxxx", "development");
config.deferredDeeplinkCallback = (deepLink) {
print('The value of deeplinkUrl is: ${deepLink.url}');
print('isDeferred: ${deepLink.isDeferred}');
print('deepLinkValue: ${deepLink.deepLinkValue}');
print('campaign: ${deepLink.campaign}');
print('campaignId: ${deepLink.campaignId}');
print('partnerId: ${deepLink.partnerId}');
print('siteId: ${deepLink.siteId}');
print('subSiteId: ${deepLink.subSiteId}');
print('ad: ${deepLink.ad}');
print('adId: ${deepLink.adId}');
print('adSet: ${deepLink.adSet}');
print('adSetId: ${deepLink.adSetId}');
print('channel: ${deepLink.channel}');
print('clickId: ${deepLink.clickId}');
print('message: ${deepLink.message}');
print('p1-p5: ${deepLink.p1} ${deepLink.p2} ${deepLink.p3} ${deepLink.p4} ${deepLink.p5}');
print('sdkParams: ${deepLink.sdkParams}');
deepLink.sdkParams?.forEach((key, value) {
print('Custom Param: $key = $value');
});
};
AppTroveFlutterSdk.initializeSDK(config);
main.dart
AppTroveFlutterSdk.resolveDeeplinkUrl("https://your-domain.u9ilnk.me/d/xxx").then((resolvedUrl) {
print("Resolved: $resolvedUrl");
});

The deferredDeeplinkCallback returns a deep link object (e.g. TrackierDeepLink / Apptrove equivalent), giving you direct access to parameters like campaign, ad, adSet, and deepLinkValue.


Use the SDK's resolveDeeplinkUrl in your activity to resolve the dynamic link and print the resulting URL to the log. (See code in tabs above.)

Steps to Test Deferred Deep Linking

Follow these comprehensive steps to properly test deferred deep linking functionality:

Prerequisites
  • APK File: Ensure you have the APK file integrated with the Apptrove SDK
  • Test Device: Android device with File Manager or WhatsApp access
  • Test URL: Valid deferred deep link URL with all required parameters

Step-by-Step Testing Process

1. Prepare the APK

  • Store the APK file locally on your device
  • Keep it accessible in File Manager or WhatsApp (as a file message)
  • Ensure the APK contains the latest SDK integration

2. Trigger the Deferred Link Click on the test deep link containing all required parameters:

https://yourdomain.u9ilnk.me/d/Af2xeLPI77?pid=Ron+Media+Source&cost_value=0&cost_currency=GBP&lbw=1d&camp=Ron+Referral+Test&dlv=RonTestClass&p2=param_2_value&sdk_param=sdk_param_value
Expected Behavior

The link should redirect you to the Google Play Store page of your app.

3. Install from Local APK (Instead of Play Store)

  • Once redirected to the Play Store, minimize it (don't install from there)
  • Open the File Manager (or WhatsApp) where the prepared APK is stored
  • This simulates the deferred deep link scenario without using the actual Play Store

4. Install the APK Manually

  • Tap on the APK file and install it on the device
  • Grant necessary permissions during installation
  • Complete the installation process

5. Launch the App

  • Open the freshly installed app
  • The SDK should automatically process the deferred deep link
  • Verify that the deep link parameters are correctly received and processed
Important Notes
  • Always test with fresh app installations to simulate real user scenarios
  • Verify that the SDK is properly initialized before processing deep links
  • Test on both development and production environments
  • Ensure network connectivity during testing

Best Practices

  • Test Both Types: Validate normal and deferred deep links to ensure seamless navigation across scenarios.
  • Use Unique Schemes: Choose unique URL schemes or domains to avoid conflicts with other apps.
  • Initialize Early: Set the deferred deep link callback during SDK initialization to capture all deep link events.
  • Handle Parameters: Parse deep link parameters (e.g., dlv, quantity) to customize in-app experiences.
  • Privacy Compliance: Ensure deep link data handling complies with privacy regulations (e.g., GDPR, CCPA).

Troubleshooting

  • Deep Link Not Opening App:
    • Verify AndroidManifest.xml (Android) or Info.plist (iOS) configurations for correct scheme and host.
    • Ensure the app is installed and the URL matches the configured pattern.
  • Deferred Deep Link Not Working:
    • Confirm the deferredDeeplinkCallback is set during SDK initialization.
    • Test with a fresh install to simulate the app store redirect scenario.
  • Universal Links Failing (iOS):
    • Check that the apple-app-site-association file is hosted correctly and accessible.
    • Verify the Associated Domains capability is enabled in Xcode.
  • Parameter Issues:
    • Ensure the deep link URL includes expected parameters and parse them correctly in the callback.

For further assistance, refer to the Apptrove Documentation Portal or contact support at support@apptrove.com.