DeepLink Plan - Flutter SDK (v4)

    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

    提示

    请根据需求选择 General SDK 或 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>

    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 Airbridge generates a tracking link, it automatically selects and utilizes the optimal Airbridge deep link, depending on the environment.

    Example)

    • Airbridge Deeplink: https://YOUR_APP_NAME.airbridge.io/~~~

    • Scheme Deeplink: YOUR_SCHEME://product/12345

    When the app is installed on a device and the user clicks the tracking link, the app opens through the Airbridge deep link. The Airbridge SDK converts the Airbridge deep link into a scheme deep link set on the tracking link. The converted scheme deep link is sent to the app.

    When the app is not installed on a device and the user clicks the tracking link, the Airbridge deep link is saved. After the user moves to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge deep link into a scheme deep link. The converted scheme deep link is sent 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.

    Was this page helpful?

    Have any questions or suggestions?