Flutter SDK

    Pub Version

    Install SDK

    airbridge_flutter_sdk pub.dev

    Install package

    pubspec setup

    Add the following dependency under the dependencies block in your pubspec.yaml file.

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

    Open the Terminal at the top level of the project and run the following command.

    The Airbridge Flutter SDK is only supported by Flutter v.1.20.0+ and Dart v.2.12.0+.

    Shell
    1
    flutter pub get

    Set up project

    Add an SDK configuration file

    1. Add the following code under the flutter/assets block in your pubspec.yaml file.

    123
    flutter:
      assets:
        - assets/airbridge.json

    2. Create an assets/airbridge.json file at the top of the project.

    For iOS

    Add the following code to the ios/[Project Name]/AppDelegate.m file.

    12345678
    import airbridge_flutter_sdk
    
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
      ) -> Bool {
        AirbridgeFlutter.initSDK(appName: "YOUR_APP_NAME", appToken: "YOUR_APP_TOKEN", withLaunchOptions: launchOptions)
    }

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

    For Android

    If the Android module Application Class is not defined in the project, create an Application class.

    Add the AirbridgeFlutter.init code in the Application class, like in the example below.

    12345678910
    import co.ab180.airbridge.flutter.AirbridgeFlutter;
    import io.flutter.app.FlutterApplication;
    
    public class MainApplication extends FlutterApplication {
        @Override
        public void onCreate() {
            super.onCreate();
            AirbridgeFlutter.init(this, "YOUR_APP_NAME", "YOUR_APP_TOKEN");
        }
    }

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

    Add the Application class created above to the AndroidManifest.xml file in the Andoird module of the project like in the example below.

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

    Settings for both iOS and Android

    airbridge.json

    1. Add the airbridge.json file to the project folder.

    2. Add the configuration values in JSON format.

    123456789101112
    {
        "sessionTimeoutSeconds": 300,
        "autoStartTrackingEnabled": true,
        "userInfoHashEnabled": true,
        "trackAirbridgeLinkOnly": false,
        "facebookDeferredAppLinkEnabled": false,
        "locationCollectionEnabled": false,
        "trackingAuthorizeTimeoutSeconds": 30,
        "sdkSignatureSecretID": "YOUR_SDK_SIGNATURE_SECRET_ID",
        "sdkSignatureSecret": "YOUR_SDK_SIGNATURE_SECRET",
        "logLevel": "warning"
    }

    Attention

    The default value of the trackingAuthorizeTimeoutSeconds in the above code is 30s. Adjust accordingly depending on your ATT prompt settings to optimize the user experience. Refer to the Tracking Authorize Timeout section for more details.

    Name

    Type

    Default

    Description

    sessionTimeoutSeconds

    Number

    300

    An app open event will not be sent when the app is reopened within the designated period.

    autoStartTrackingEnabled

    Boolean

    true

    When set to false, no events will be sent until Airbridge.state.startTracking() is called.

    userInfoHashEnabled

    Boolean

    true

    When set to false, user email and user phone information are sent without being hashed.

    trackAirbridgeLinkOnly

    Boolean

    false

    When set to true, deep link events are sent only when app is opened with an Airbridge deep link.

    facebookDeferredAppLinkEnabled

    Boolean

    false

    When set to true and the Facebook SDK is installed, Facebook Deferred App Link data is collected.

    metaInstallReferrer

    String

    null

    Collects Meta Install Referrer for Android. facebookInstallReferrer can be used instead of metaInstallReferrer. When using both keys, the metaInstallReferrer is applied.
    This feature is supported in Airbridge Flutter SDK v3.5.4+.

    locationCollectionEnabled

    Boolean

    false

    When set to true, location information is collected. (Android Only)
    Two permissions must be allowed in AndroidManifest.xml
    android.permission.ACCESS_FINE_LOCATION
    android.permission.ACCESS_COARSE_LOCATION

    trackingAuthorizeTimeoutSeconds

    Number

    30

    When timeout is set, Install event sending is delayed until  Request tracking authorization alert is clicked. (iOS only)

    sdkSignatureSecretID

    String

    null

    Protects against SDK spoofing. Both sdkSignatureSecretID and sdkSignatureSecret values must be applied.

    sdkSignatureSecret

    String

    null

    Protects against SDK spoofing. Both sdkSignatureSecretID and sdkSignatureSecret values must be applied.

    logLevel

    String

    warning

    Adjusts the log record level for Airbridge.
    logLevel: "debug" | "info" | "warning" | "error" | "fault"

    SDK testing

    Check if install events are sent when the application is installed and opened.

    Using the Airbridge dashboard

    1. Install and open the app on a test device.

    2. Navigate to [Raw Data]>[App Real-time Logs] in the Airbridge dashboard.

    3. Enter the ADID (IDFA, IDFA, or GAID) of the test device into the search bar to find it in the logs.

    It may take up to 5 minutes for the logs to be visible in the dashboard.

    Attention

    Logs may be delayed for up to 5 minutes.

    Deep Linking

    Set up dashboard

    Refer to the guides below to set up deep links in the Airbridge dashboard.

    Set up project

    Adding URL Scheme

    1. Open the iOS module's *.xcodeproj or *.xcworkspace of the project in Xcode.

    2. Go to [Xcode]>[Project file]>[Info]>[URL Types].

    3. From the Airbridge dashboard, copy "iOS URI Scheme" and paste it into Xcode's "URL Schemes field. (Do not include://)

    1. Open the iOS module's *.xcodeproj or *.xcworkspace of the project in Xcode.

    2. Go to [Xcode]>[Project file]>[Signing & Capabilities].

    3. In the [Associated Domains] tab, add the following information.

    • applinks:YOUR_APP_NAME.airbridge.ioto "Associated Domains"

    • applinks:YOUR_APP_NAME.deeplink.pageto "Associated Domains"

    YOUR_APP_NAME can be found at [Settings]>[Tokens] in the Airbridge dashboard.

    AppDelegate Setup

    1. Open the AppDelegate in the project's iOS module.

    2. Add the following functions.

    123456789101112131415
    override func application(
        _ application: UIApplication,
        continue userActivity: NSUserActivity,
        restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
    ) -> Bool {
        AirbridgeFlutter.deeplink.handle(userActivity)
        
        return true
    }
    
    override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        AirbridgeFlutter.deeplink.handleURLSchemeDeeplink(url)
        
        return true
    }

    AndroidManifest.xml Setup

    Follow the steps below and configure the Intent Filter.

    1. Open the AndroidManifest.xml file in the project's Android module.

    2. Add the following functions.

    123456789101112131415161718192021222324252627282930
    <activity ...>
        ...
        <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="http" android:host="YOUR_APP_NAME.deeplink.page" />
            <data android:scheme="https" android:host="YOUR_APP_NAME.deeplink.page" />
        </intent-filter>
        <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="http" android:host="YOUR_APP_NAME.airbridge.io" />
            <data android:scheme="https" android:host="YOUR_APP_NAME.airbridge.io" />
        </intent-filter>
        <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:scheme="YOUR_APP_URI_SCHEME" />
        </intent-filter>
        ...
    </activity>

    YOUR_APP_NAME and YOUR_APP_URI_SCHEME can be found at [Settings]>[Tokens] in the Airbridge dashboard.

    MainActivity Setup

    Insert the following code to the android/app/src/main/java/.../MainActivity.java file.

    1. Open the MainActivity file in the project's Android module.

    2. Add the following functions.

    1234567891011
    @Override
    protected void onResume() {
        super.onResume()
        AirbridgeFlutter.processDeeplink(intent)
    }
    
    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent)
        setIntent(intent)
    }

    Use the following method to set up the callback that should be called when the app is opened through a deep link.

    1234
    Airbridge.deeplink.setDeeplinkListener((deeplink) {
        // airbridge deeplink = SCHEME://...
        print('$deeplink');
    });

    If setDeeplinkListener is called from the main function, make sure that WidgetsFlutterBinding.ensureInitialized(); is called first.

    Check whether the app opens and the deep link event is sent when the Airbridge deep link is clicked on. The Airbridge deep link should follow the YOUR_SCHEME://... format. Your_Scheme is the iOS URI Scheme entered in your Airbridge dashboard.

    • Click the deep link.

    • Check whether the deep link event appears on the [Raw Data]>[App Real-time Logs] page in the Airbridge dashboard.

    User Data

    Set up user identifier

    You can set up the SDK so that once a user identifier is sent to the SDK, all events collected thereafter contain the same user identifier. The following identifiers are collected.

    • User Email: Email address

    • User Phone: Phone number

    • User ID: Unique User ID (ID that identifies users on both web and mobile)

    • User Alias: Alternative identifier representing users (e.g., loyalty program ID, affiliate integrated ID, etc.)

    The user email and phone number are hashed (SHA256) by default before being sent to servers.

    Refer to the following method for the setup.

    12345678910
    Airbridge.state.setUser(
        User(
        id: 'tester',
        email: 'tester@ab180.co',
        phone: '+82 10 0000-0000',
        alias: {
            'alias_key': 'alias_value',
        },
        )
    );

    Name

    Description

    Limitations

    id

    User ID

    -

    email

    User email

    Hashed by default
    (SHA256, can be disabled)

    phone

    User phone number

    Hashed by default
    (SHA256, can be disabled)

    alias

    User alias

    - Maximum 10 aliases
    - key type is String, maximum 128 characters supported
    - key must satisfy ^[a-z_][a-z0-9_]*$regex
    - value type is String, maximum 1024 characters supported

    Attention

    The user identifier can be reset or overwritten depending on the events performed by the user.

    Below is an example of how a particular field can be updated.

    12345
    Airbridge.state.updateUser(
        User(
            id: 'sam1234',
        )
    );

    Set up user attributes

    Additional user attributes can be collected for a more accurate multi-touch attribution and in-depth data analysis.

    1234567
    Airbridge.state.setUser(
        User(
        attributes: {
            'attr_key': 'attr_value',
        },
        )
    );

    Name

    Description

    Limitations

    attributes

    User attribute

    - Maximum 100 attributes
    - key type is String, maximum 128 characters supported
    - key must satisfy ^[a-z_][a-z0-9_]*$regex
    - value type can be Integer, Float, Long, Boolean or String
    - Maximum 1024 characters supported when value is string

    Attention

    The user attribute information can be reset or overwritten depending on the events performed by the user.

    User data setup testing

    Check whether the user data setup has been successfully completed by following the steps below.

    1. Complete the user setup.

    2. Send an event through the SDK.

    3. Navigate to [Raw Data]>[App Real-time Logs] in the Airbridge dashboard and find the event sent.

    Device Data

    Set up device alias

    Set up the Airbridge SDK to collect device aliases when collecting events. The alias won't be deleted even after the user closes the app unless the user deletes the app.

    123
    Airbridge.setDeviceAlias("ADD_YOUR_KEY", "AND_YOUR_VALUE");
    Airbridge.removeDeviceAlias("DELETE_THIS_KEY");
    Airbridge.clearDeviceAlias();

    setDeviceAlias(key: string, value: string)

    Adds the key-value pair to the device identifier.

    removeDeviceAlias(key: string)

    Deletes the device alias of the key. If there is no identifier, no action is executed.

    clearDeviceAlias()

    Deletes all device aliases.

    In-app Events

    When important user actions occur, those actions can be collected as in-app events.

    Although all event parameters are optional, collecting as much information about the event as possible will help provide a more accurate analysis.

    Action, label, value, customAttributes, and semanticAttributes can be used as event options.

    Name

    Type

    Description

    category

    String

    Name of the event

    *Required

    action

    String

    Event attribute 1

    label

    String

    Event attribute 2

    value

    Float

    Event attribute value

    customAttributes

    Map <String, dynamic>

    Custom attributes

    semanticAttributes

    Map <String, dynamic>

    Semantic attributes

    123
    static void trackEvent(String category, [ AirbridgeEventOption? option ]) {
        event.trackEvent(category, option);
    }

    Send in-app events

    You can send in-app events through the SDK to Airbridge for ad performance measurement.

    Sign-Up

    When sending the Sign-up event, the user identifier is sent through setUser and AirbridgeCategory.SIGN_UP is sent.

    123456
    Airbridge.state.setUser(User(
        id: 'tester',
        email: 'tester@ab180.co',
        phone: '+82 10 0000-0000',
    ));
    Airbridge.trackEvent(AirbridgeCategory.SIGN_UP);

    Sign-In

    When sending the Sign-in event, the user identifier is sent through setUser if it is not entered already and AirbridgeCategory.SIGN_IN is sent.

    123456
    Airbridge.state.setUser(User(
        ID: 'test',
        email: 'test@ab180.co',
        phone: '000-0000-0000',
    ));
    Airbridge.trackEvent(AirbridgeCategory.SIGN_IN);

    Sign-Out

    When sending the Sign-in event, AirbridgeCategory.SIGN_OUT is sent, and the user identifier is reset.

    12
    Airbridge.trackEvent(AirbridgeCategory.SIGN_OUT);
    Airbridge.state.setUser(User());

    View Home Screen

    1
    Airbridge.trackEvent(AirbridgeCategory.HOME_VIEW);

    View Product Detail

    123456789101112131415
    Airbridge.event.trackEvent(
      AirbridgeCategory.PRODUCT_DETAILS_VIEW,
      AirbridgeEventOption(
        semanticAttributes: {
          AirbridgeAttributes.PRODUCTS: [{
              AirbridgeProduct.PRODUCT_ID: 'coke_zero',
              AirbridgeProduct.NAME: 'Coke Zero',
              AirbridgeProduct.PRICE: 1.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 1,
              AirbridgeProduct.QUANTITY: 1,
            },
          ]
        }
    ));

    View Product List

    1234567891011121314151617181920212223
    Airbridge.event.trackEvent(
      AirbridgeCategory.PRODUCT_DETAILS_VIEW,
      AirbridgeEventOption(
        semanticAttributes: {
          AirbridgeAttributes.PRODUCT_LIST_ID: 'ID-1234567890',
          AirbridgeAttributes.PRODUCTS: [{
              AirbridgeProduct.PRODUCT_ID: 'coke_zero',
              AirbridgeProduct.NAME: 'Coke Zero',
              AirbridgeProduct.PRICE: 1.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 1,
              AirbridgeProduct.QUANTITY: 1,
            }, {
              AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
              AirbridgeProduct.NAME: 'Double Cheeseburger',
              AirbridgeProduct.PRICE: 3.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 2,
              AirbridgeProduct.QUANTITY: 1,
            }
          ]
        }
    ));

    View Search Result

    1234567891011121314151617181920212223
    Airbridge.event.trackEvent(
      AirbridgeCategory.SEARCH_RESULT_VIEW,
      AirbridgeEventOption(
        semanticAttributes: {
          AirbridgeAttributes.QUERY: 'product',
          AirbridgeAttributes.PRODUCTS: [{
              AirbridgeProduct.PRODUCT_ID: 'coke_zero',
              AirbridgeProduct.NAME: 'product A',
              AirbridgeProduct.PRICE: 1.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 1,
              AirbridgeProduct.QUANTITY: 1,
            }, {
              AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
              AirbridgeProduct.NAME: 'product B',
              AirbridgeProduct.PRICE: 3.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 2,
              AirbridgeProduct.QUANTITY: 1,
            }
          ]
        }
    ));

    Add To Cart

    12345678910111213141516171819202122232425
    Airbridge.event.trackEvent(
      AirbridgeCategory.ADD_TO_CART,
      AirbridgeEventOption(
        value: 5.98,
        semanticAttributes: {
          AirbridgeAttributes.CART_ID: 'ID-1234567890',
          AirbridgeAttributes.CURRENCY: 'USD',
          AirbridgeAttributes.PRODUCTS: [{
              AirbridgeProduct.PRODUCT_ID: 'coke_zero',
              AirbridgeProduct.NAME: 'Coke Zero',
              AirbridgeProduct.PRICE: 1.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 1,
              AirbridgeProduct.QUANTITY: 1,
            }, {
              AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
              AirbridgeProduct.NAME: 'Double Cheeseburger',
              AirbridgeProduct.PRICE: 3.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 2,
              AirbridgeProduct.QUANTITY: 1,
            }
          ]
        }
    ));

    Purchase

    1234567891011121314151617181920212223242526
    Airbridge.event.trackEvent(
      AirbridgeCategory.ORDER_COMPLETED,
      AirbridgeEventOption(
        value: 5.98,
        semanticAttributes: {
          AirbridgeAttributes.TRANSACTION_ID: 'transactionID-purchase',
          AirbridgeAttributes.CURRENCY: 'USD',
          AirbridgeAttributes.IN_APP_PURCHASED: true,
          AirbridgeAttributes.PRODUCTS: [{
              AirbridgeProduct.PRODUCT_ID: 'coke_zero',
              AirbridgeProduct.NAME: 'Coke Zero',
              AirbridgeProduct.PRICE: 1.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 1,
              AirbridgeProduct.QUANTITY: 1,
            }, {
              AirbridgeProduct.PRODUCT_ID: 'burger_cheese_double',
              AirbridgeProduct.NAME: 'Double Cheeseburger',
              AirbridgeProduct.PRICE: 3.99,
              AirbridgeProduct.CURRENCY: 'USD',
              AirbridgeProduct.POSITION: 2,
              AirbridgeProduct.QUANTITY: 1,
            }
          ]
        }
    ));

    To configure and send Semantic Attributes manually, refer to this article.

    Event transmission testing

    Send an event through the SDK and check whether the event is available in the Airbridge dashboard.

    • Send an event through the SDK.

    • Navigate to [Raw Data]>[App Real-time Logs] in the Airbridge dashboard and search for the event.

    Advanced Settings

    Set up Meta Install Referrer collection

    Meta Install Referrer (MIR) collection is supported by Airbridge Flutter SDK v3.5.4 or later. Add the method below to the airbridge.json to collect the Meta Install Referrer.

    After the setup, you need to enter the decryption key into the Airbridge dashboard to view the decrypted Meta Install Referrer. Refer to this user guide to learn how to enter the decryption key.

    123
    {
        "metaInstallReferrer": "YOUR_META_APP_ID"
    }

    Set up attribution result callback

    This feature is supported by Flutter SDK v3.5.0 and later. Follow the method below to get the attribution result data through the Airbridge SDK.

    123
    Airbridge.setAttributionListener((result) { 
        // do something
    });

    The table below lists the data fields that will be collected through the callback.

    Field

    Description

    attributedChannel

    Channel (String)

    attributedCampaign

    Campaign (String)

    attributedAdGroup

    Ad Group (String)

    attributedAdCreative

    Ad Creative (String)

    attributedContent

    Content (String)

    attributedTerm

    Keyword (String)

    attributedSubPublisher

    Sub Publisher (String)

    attributedSubSubPublisher1

    Sub-sub Publisher 1 (String)

    attributedSubSubPublisher2

    Sub-sub Publisher 2 (String)

    attributedSubSubPublisher3

    Sub-sub Publisher 3 (String)

    Install 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. The Restricted SDK is supported in v.3.4.3 and later.

    pubspec settings

    Add the following line to the dependencies block in the pubspec.yaml file.

    12
    dependencies:
      airbridge_flutter_sdk_restricted : 3.4.3

    Open the Terminal at the top-level file of the project and run the command below.

    Shell
    1
    flutter pub get

    Set up SDK Signature

    With the SDK Signature, you can ensure SDK spoofing prevention and use verified events for ad performance measurement. The SDK Signature is supported for the Airbridge Flutter SDK v3.2.0 and later.

    Add the following lines in the airbridge.json file.

    1234
    {
        "sdkSignatureSecretID": "YOUR_SDK_SIGNATURE_SECRET_ID",
        "sdkSignatureSecret": "YOUR_SDK_SIGNATURE_SECRET"
    }

    The SDK Signature Credentials are required for the SDK Signature setup. Refer to this article to learn how to create them.

    Set up session timeout

    You can set the Airbridge SDK to not send an App Open event again if a user relaunches the app within a set session time by configuring the sessionTimeoutSeconds field in the airbridge.json file added in the previous step.

    • The session timeout value is in milliseconds. The value should be between 0 and 604800000 (7 days).

    • The default value is 1000 * 60 * 5 (5 minutes).

    Disable user identifier hashing

    If you want to send user identifiers, such as the user email and user phone, without hashing, configure the userInfoHashEnabled field in the airbridge.json file added in the previous step.

    Attention

    このオプションはユーザーのEメールや電話番号など、敏感な個人情報を第3者に提供することになるため、あらかじめ内部的なセキュリティ措置が必要となります。

    Configure the facebookDeferredAppLinkEnabled field in the airbridge.json file added in the previous step to receive the Facebook deferred app links through the Airbridge SDK.

    When the facebookDeferredAppLinkEnabled is set to YES, and the Facebook SDK is installed, the SDK collects the Facebook Deferred App Link.

    Attention

    To use this feature, the Facebook SDK must be set up accordingly. Refer to this Facebook document for the setup.

    It may be difficult to measure re-engagement if the Airbridge SDK collects all types of deep link events. Configure the trackAirbridgeLinkOnly field in the airbridge.json file added in the previous step to track only Airbridge deep links.

    When activating this feature, the SDK will collect Airbridge deep link events only in the following cases:

    • When the app is opened through an airbridge.io deep link

    • When the app is opened through a deeplink.page deep link

    • When the app is opened through a deep link with the Custom Domain that is set in the Airbridge dashboard

    • When the app is opened through a deep link that contains the airbridge_referrer in the query

    Opt-in setup

    The opt-in policy requires user consent before using user data. The opt-in setup is required to collect and transmit data after obtaining consent for personal data tracking from users, especially when GDPR or CCPA applies.

    Configure the autoStartTrackingEnabled field in the airbridge.json file added in the previous step and call the following function to make sure data collection starts after users provide their explicit consent.

    react-native
    1
    Airbridge.state.startTracking();

    Tracking authorize timeout (iOS only)

    When using the AppTrackingTransparency.framework to display the ATT prompt to the user, the IDFA is not collected when the install event occurs because the ATT prompt only appears after the user installs the app.

    By setting the timeout of the trackingAuthorizeTimeoutSeconds in the airbridge.json file added in the previous step, the sending of the install event will be delayed for the set timeout period to wait for the user to finish responding to the ATT prompt.

    Collect user location information (Android only)

    Configure the locationCollectionEnabled field in the airbridge.json file added in the previous step to collect the user location information.

    Attention

    位置情報は合法的な目的と方法で収集することが大前提となるため、この機能の使用には注意が必要です。

    This feature is supported for only Android and the following permission must be included in the  AndroidManifest.xml.

    12
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    When clicking tracking links, users are sent to a browser. However, you can redirect users to specific in-app locations without sending them to an external browser by using the method below.

    12
    Airbridge.placement.click('https://abr.ge/~~~', 'ablog://main', 'https://airbridge.io');
    Airbridge.placement.impression('https://abr.ge/~~~');

    Click

    When a user clicks on the tracking link within the app, the Airbridge.click function is called. A click event is collected, and the user is redirected to the configured app or web fallback path.

    The deep link and fallback path are backup links used when there is no network connection. Only custom URL scheme deep links can be used as deep link parameters. Note that they are all optional parameters.

    Impression

    When a user engages with a tracking link within the app, the Airbridge.click function is called. An impression event is collected.

    When using the custom domain, tracking links with a custom short ID are not viable for use.

    • example: http://deeplink.ab180.co/custom -> Not viable for use

    • example: http://deeplink.ab180.co/a3b1c2 -> Viable for use

    • example: https://abr.ge/a3b1c2 -> Viable for use

    Collect device UUID

    1
    await Airbridge.state.deviceUUID()

    Set up uninstall tracking

    This feature is supported for Airbridge Flutter SDK v3.0.2 and later.

    • Airbridge Android SDK v2.6.0

    • Airbridge iOS SDK v1.28.2

    For more information about uninstall tracking, refer to this article.

    Send Push Token

    1
    Airbridge.registerPushToken(token);

    Forward the push token to Airbridge using the registerPushToken method.

    Silence push notifications

    The silent push notifications Airbridge sends for uninstall tracking should not be displayed in the user's app. Make sure the silent push is silenced when the airbridge-uninstall-tracking is true in the forwarded remote data.

    Hybrid App Setup

    While basic events, such as Install, Open, and Deeplink Open events, can be automatically tracked by only installing the Android SDK in your hybrid app, in-app events, such as Sign-up, Purchase, etc., cannot be tracked as they are in-browser events that occur within a website of the WebView environment. Airbridge provides a simpler way to track in-app events by enabling the Flutter SDK to automatically pull all events from the Web SDK that is installed on the website of the WebView environment. This replaces the hassle of having to create bridge functions between native and WebView environments. Refer to the following method.

    12345
    Airbridge.createWebInterface(
          webToken: 'YOUR_WEB_TOKEN',
          postCommandFunction: (arg) {
            return """..."""; 
        });

    You can control the web interface through the Airbridge.createWebInterface. Refer to the Flutter Hybrid App Integration Guide for details.

    Troubleshooting

    Bitcode Compile Error

    An error like the one below may occur when creating iOS builds with Flutter SDK v3.0.1 or later as the Bitcod is not supported.

    Text
    1
    ld: XCFrameworkIntermediates/AirBridge/AirBridge.framework/AirBridge(AirBridge-arm64-master.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)

    Flutter SDK v3.0.1+ is updated to Airbridge iOS SDK v1.28.0+, and Bitcode is no longer supported. Refer to the Bitcode compile error guide for more details.

    settings.gradle (Android only)

    If you encounter the error message "Plugin project ... not found. Please update settings.gradle," edit the android/settings.gradle file as shown below.

    123456789101112131415
    include ':app'
    
    def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
    
    def plugins = new Properties()
    def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
    if (pluginsFile.exists()) {
        pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
    }
    
    plugins.each { name, path ->
        def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
        include ":$name"
        project(":$name").projectDir = pluginDirectory
    }

    Could not find or use auto-linked library...

    Flutter issue: https://github.com/flutter/flutter/issues/16049

    Airbridge Flutter SDK is a Swift plugin, and an error occurs when the Swift Plugin is used in a 100% Objective C project uses the Swift Plugin.
    To solve this issue, click File > New > File... > Swift File to create an empty Swift file and a bridge header.

    This issue does not occur when using Objective C & Swift Project and 100% Swift Project.

    SDK Migration

    When updating the SDK, consider the content regarding versions between the previous version and the later version or your updated version.

    v3.5.0

    For apps registered with Airbridge after November 4, 2023, an issue where the deep link URL provided in the deep link callback was decoded twice from the content entered in the Airbridge dashboard has been resolved. This issue was found in versions 3.4.2 to 3.4.7.

    v3.4.2

    For apps registered with Airbridge after September 4, 2023, the "airbridge_referrer" will no longer be added to the deep link URL provided in the deep link callback.

    When updating the app from iOS SDK v1.33.0 or earlier to v1.33.0 or later, the last calculated SKAN conversion value will be finalized, and no additional calculation will be processed.

    • For iOS SDK versions earlier than 1.33.0, the SKAN conversion value is calculated for up to 24 hours.

    • There is no issue for users who newly install the SDK.

    deeplink.page has been deprecated. From v3.4.2 onwards, we recommend writing code using the abr.ge deep link domain.

    • deeplink.page is still supported and operates for backward compatibility.

    v3.4.1

    The Kotlin plugin has been updated to version 1.5.21.

    v3.4.0

    The default setting for trackingAuthorizeTimeout changed from 0 seconds to 30 seconds.

    Update from v2.X.X to v3.X.X

    The existing event API was deleted and replaced with the API below.

    123
    static void trackEvent(String category, [ AirbridgeEventOption? option ]) {
      event.trackEvent(category, option);
    }

    Update from v1.X.X to v2.X.X

    iOS

    Change the AppDelegate's AirbridgeFL class to the AirbridgeFlutter class.

    Android

    1. Change the AirbridgeFL class of the MainApplication and MainActivity to the AirbridgeFlutter class.

    2. Change the processDeeplinkData function in the MainActivity to processDeeplink function.

    このページは役に立ちましたか?

    ご質問やご提案はありますか?