DeepLink Plan - Flutter SDK (v4)

Pub Version

Install the Airbridge Flutter SDK and implement the necessary settings following the steps below.

Install SDK

The Airbridge React Native SDK can be installed using the method below. After installation, you can verify whether the SDK has been properly installed through .

1. Add the following code to the dependencies block in the pubspec.yaml file.

123
dependencies:
  # Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk/versions
  airbridge_flutter_sdk: HERE_LATEST_VERSION

2. Open Terminal at the root directory of the project and run the following command.

Note that the Airbridge Flutter SDK only works for Flutter versions 1.20.0 or later and Dart versions 2.12.0 or later.

Shell
1
flutter pub get

Install Restricted SDK

Attention

Install only one version of the SDK, either the general SDK or the restricted SDK.

Depending on policies and environments, restrictions on collecting device IDs like GAID and IDFA may be required. When installing the Restricted SDK version, the device IDs are not collected.

Install the Restricted SDK using the method below.

1. Add the following code to the dependencies block in the pubspec.yaml file.

123
dependencies:
  # Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk_restricted/versions
  airbridge_flutter_sdk_restricted: HERE_LATEST_VERSION

2. Open Terminal at the root directory of the project and run the following command.

Shell
1
flutter pub get

Initialize SDK

The initialization methods for iOS and Android are different. Refer to the methods described below.

Note that the YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.

iOS

Add the following code to the AppDelegate class file in the iOS module of the project.

12345678
import airbridge_flutter_sdk

override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    AirbridgeFlutter.initializeSDK(appName: "YOUR_APP_NAME", appToken: "YOUR_APP_SDK_TOKEN")
}

Android

If an application class is not defined in the Android module of the project, create one.

Add the following code to the android/app/src/main/java/.../MainApplication.kt file.

123456789
import co.ab180.airbridge.flutter.AirbridgeFlutter
import io.flutter.app.FlutterApplication

class MainApplication: FlutterApplication() {
    override fun onCreate() {
        super.onCreate()
        AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
    }
}

Register the application class created earlier in the AndroidManifest.xml file of the Android module of the project as follows.

12345
<application
    android:name=".MainApplication"
    ...>
    ...
</application>

Configure SDK settings

Configure the SDK settings to use the Airbridge Flutter SDK.

1234
{
    "autoDetermineTrackingAuthorizationTimeoutInSecond": number,
    "isHandleAirbridgeDeeplinkOnly" : boolean
}
  1. Create an airbridge.json file at the top level of the Flutter project folder, input the JSON as above, and configure the SDK settings.

  2. Don't input values for keys that are not necessary for your service.

For detailed guidance on the individual key values, refer to the links listed below.

Configure ATT prompt

Note

The functions necessary to ensure compliance with privacy policies should be reviewed with legal counsel.

In the iOS environment, the IDFA can only be collected when users provide consent for data tracking through the AppTrackingTransparency (ATT) prompt.

Event collection should be delayed until the user allows tracking. If the install event is collected before the user allows tracking through the ATT prompt, the install event data will lack an identifier, making performance measurement difficult. We recommend setting a sufficient delay time for event collection to collect identifiers.

1. Prepare the text you will use in the ATT prompt.

2. Provide the ATT prompt following this guide provided by Apple.

3. If the install event is not collected, the Airbridge Flutter SDK delays collecting install events for 30 seconds until the user allows tracking each time the app is launched. If the user exits the app before deciding whether to allow tracking, the SDK will not collect the install event and will try again at the next app launch.

In the SDK settings, configure autoDetermineTrackingAuthorizationTimeout to set a sufficient delay time for collecting install events. The default value is 300 seconds, and it can be set up to 3600 seconds (1 hour).

When using the DeepLink Plan, it is recommended that the setAutoDetermineTrackingAuthorizationTimeout parameter be set to 0 seconds when configuring the ATT prompt.

As the DeepLink Plan does not support attribution using identifiers, the setAutoDetermineTrackingAuthorizationTimeout parameter should be set to 0 seconds to seamlessly redirect users who have already installed the app to the intended in-app location as configured in the deferred deep link.

Deep Linking

Deep linking allows you to redirect users from ads to specific locations within your app. The data collected from the tracking link enables you to monitor the performance of the deep link in Airbridge.

When a user clicks on the Airbridge tracking link, the scheme deep link embedded in the tracking link is converted into an Airbridge Deep Link, which can be either an HTTP deep link or a scheme deep link. This Airbridge Deep Link redirects the user to the desired app location. Then, the Airbridge SDK converts the Airbridge Deep Link back to the original scheme deep link embedded in the tracking link and passes it to the app.

  • Example scheme deep link embedded in the tracking link: YOUR_SCHEME://product/12345

  • Examples of Airbridge Deep Links

    • HTTP deep link format 1: https://YOUR_APP_NAME.airbridge.io/~~~

    • HTTP deep link format 2: https://YOUR_APP_NAME.abr.ge/~~~

    • Scheme deep link format: YOUR_SCHEME://product/12345?airbridge_referrer=~~~

When the app is installed on the device and the tracking link is clicked, the app opens through the Airbridge Deep Link. The Airbridge SDK converts the Airbridge Deep Link into the scheme deep embedded in the tracking link and passes it to the app.

When the app is not installed on the device and the tracking link is clicked, the Airbridge SDK saves the Airbridge Deep Link is saved. After the user is redirected to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge Deep Link into the scheme deep embedded in the tracking link and passes it to the app.

Set up deep linking

For the deep linking setup, the deep link information entered to the Airbridge dashboard and the in-app location address for user redirection is required.

First, enter the deep link information into the Airbridge dashboard.

After entering the deep link information into the Airbridge dashboard, an additional setup is required to enable the following.

  • App launch with Airbridge deep links

  • Airbridge deep link event collection

  • User redirection with Airbridge deep links

For detailed instructions, refer to the information below.

Set up deferred deep linking

When a user clicks on a tracking link with deferred deep linking capabilities and your app is not installed on the device, the Airbridge SDK retrieves the deep link as follows.

Deferred deep links are automatically passed to OnDeeplinkReceived, so no additional setup is required.

Testing

The SDK functionality test and deep link test allow you to check whether the SDK and deep linking work as intended.

Additional SDK Settings

Follow the instructions below for additional setup.

Attention

Optional settings. Configure only if necessary.

Note

The Airbridge Flutter SDK must be v4.1.2 or later.

The deep links passed through the setOnDeeplinkReceived method of the Airbridge Flutter SDK include not only Airbridge Deep Links but also deep links from other solutions.

12345
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.setOnDeeplinkReceived((url) {
    // show proper content using url
});

By configuring isHandleAirbridgeDeeplinkOnly to true in the SDK settings, only Airbridge Deep Links will be passed to the setOnDeeplinkReceived callback. In this way, you can handle the deep links from other solutions separately from the Airbridge Deep Links.

Was this page helpful?

Have any questions or suggestions?