LogoLogo
Go to Airflux
  • Welcome to Airflux
  • Airflux Onboarding
    • Airflux Integration
      • 1. Add your app to the dashboard
      • 2. Install the Airflux SDK
      • 3. Send in-game event data
      • 4. Call the Inference API
  • Reporting
  • Airflux Reference
    • How inference works
    • Required event data for Airflux integration
    • Preparing for the App Store Review
    • Unity SDK Reference
Powered by GitBook

Links

  • Need help? Contact Support
  • Question? Contact Sales
On this page
  • 1. Import the Airflux package
  • 2. Set up SDK initialization
  • Frequently Asked Questions
  • Troubleshooting
  1. Airflux Onboarding
  2. Airflux Integration

2. Install the Airflux SDK

Previous1. Add your app to the dashboardNext3. Send in-game event data

Last updated 3 hours ago

By installing the Airflux SDK in your app, you can collect in-game data required for Airflux's model training. The installation and setup will take approximately 5 minutes.

Note

The Airflux SDK is currently available for Unity only.


1. Import the Airflux package

Follow the steps below to add the Airbridge SDK package file to your project.

  1. Download the latest version of the.

  2. Import the package file by selecting the menu option [Assets]>[Import Package]>[Custom Package].

  3. When the import is complete, the [Airflux] tab will appear in the top menu bar of the Unity Editor.

2. Set up SDK initialization

The SDK initializes automatically every time your app is opened.

Opt-in policy compliance

If player consent is required to send in-game data, implement the necessary setup by following the FAQ section below.

How can I set up the Airflux SDK to comply with the opt-in policy?

Select [Airflux]>[Airflux Settings] from the top menu bar in the Unity Editor and configure the keys as listed below.

Key
Required /Optional
Data Type
Default
Description

App Name

Required

string

-

Input the App Name from the Airbridge dashboard.

App Token

Required

string

-

Input the SDK Token from the Airbridge dashboard.

Log Level

Optional

string

warning

Set the log level for the Airflux SDK. Choose from debug, info, warning, error, fault .

Session Timeout Seconds

Optional

double

300

The default value is 300 seconds. Modify if needed.

Country Allowlist

Required

array

[ ]

Set the countries where calling the Airflux's inference API should be allowed. Use country codes following the ISO 3166-1 alpha-2 format (e.g., US, KR). You can set multiple countries using the Country Allowlist array. An empty array []means no country is allowed.

Auto Start Tracking Enabled

Optional

boolean

false

Set whether to collect events automatically upon SDK initialization. - true: Event collection starts automatically upon initialization. - false: Event collection starts upon calling the Airflux.StartTracking() function.

SDK Enabled

Optional

boolean

false

Set whether to enable the SDK upon initialization. - true: The SDK is initialized in active mode. - false: The SDK is initialized in inactive mode and is enabled upon calling theAirflux.EnableSDK()function.

Frequently Asked Questions

How can I set up the Airflux SDK to comply with the opt-in policy?

The opt-in policy requires user consent before collecting and using player data. To adhere to this policy, implement the following methods.

  1. SDK opt-in setup

Upon initialization of the Airflux SDK, set Auto Start Tracking Enabled to false and call the StartTracking() function at the point where you received user consent for data tracking. The Airflux SDK will collect data after the StartTracking() function is called.

Attention

Although event data is not tracked before StartTracking() is triggered and after StopTracking() is triggered, player attribute data is aggregated and anonymized for transmission upon calling the Inference API.

// After player provided consent to data tracking
Airflux.StartTracking();

//If player withdraws consent to data tracking
Airflux.StopTracking();

  1. Initializing the Airflux SDK in inactive mode

Attention

If the SDK is not enabled immediately after the SDK initialization, the Install and Open events may not be collected.

Set SDK Enabled to false to initialize the SDK with all functions disabled until user consent for data tracking is obtained. Through this method, you can adhere to privacy policies to the highest level. Note that when the SDK is set in inactive mode, all features are disabled and no events and player attribute data is sent to Airflux.

// Checks whether the SDK is currently enabled.
Airbridge.IsSDKEnabled()
// Enables the SDK.
Airbridge.EnableSDK()
// Disables the SDK.
Airbridge.DisableSDK()
Can I configure the Airflux SDK to call the Inference API only in specific countries?

Yes. You can specify countries by setting the "Country Allowlist". Country codes should follow the ISO 3166-1 alpha-2 format (e.g., "US", "KR"), and multiple countries can be specified by separating codes with commas.

Can I use other mediation platforms, such as MAX and AdMob, with Airflux?

Yes, Airflux is designed to work alongside existing mediation platforms.

Is IL2CPP supported?

Yes, Airflux supports IL2CPP.

Can I use Airflux without ADID collection?

Troubleshooting

[Android] A coroutine dependency error occurs during the build process.

Issue

A coroutine dependency error occurs during the build process with the following message.

java.lang.NoClassDefFoundError: kotlin/coroutines/AbstractCoroutineContextKey
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
  ...

Cause

Solution

Check whether the kotlin-stdlib library version is v.1.3.70 or later with the gradlew dependencies command. If the version is earlier than v.1.3.70, you need to update it.

[Android] The "Manifest merger failed" error occurs during the build process

Issue

The "Manifest merger failed" error occurs during the build process.

Cause

The Airbridge SDK's AndroidManifest.xml includes rules to opt out of backing up the Shared Preferences data. The purpose of this rule is to avoid retaining the same Airbridge settings during the reinstallation of the app so that new installs or reinstalls can be detected accurately.

Merging Airbridge SDK backup rules with your app backup rules can cause conflicts.

Solution

Below are the opt-out rules defined in the Airbridge SDK.

Backup on Android 12 or laterBackup on Android 11 and earlier123456789101112131415161718192021

<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
    <cloud-backup>
        <exclude domain="sharedpref" path="airbridge-internal" />
        <exclude domain="sharedpref" path="airbridge-install" />
        <exclude domain="sharedpref" path="airbridge-user-info" />
        <exclude domain="sharedpref" path="airbridge-user-alias" />
        <exclude domain="sharedpref" path="airbridge-user-attributes" />
        <exclude domain="sharedpref" path="airbridge-device-alias" />
        <exclude domain="database" path="airbridge.db" />
    </cloud-backup>
    <device-transfer>
        <exclude domain="sharedpref" path="airbridge-internal" />
        <exclude domain="sharedpref" path="airbridge-install" />
        <exclude domain="sharedpref" path="airbridge-user-info" />
        <exclude domain="sharedpref" path="airbridge-user-alias" />
        <exclude domain="sharedpref" path="airbridge-user-attributes" />
        <exclude domain="sharedpref" path="airbridge-device-alias" />
        <exclude domain="database" path="airbridge.db" />
    </device-transfer>
</data-extraction-rules>

Fix conflict with fullBackupContent="string"

Adding android:fullBackupContent="string" to the AndroidManifest.xml file may cause an error like the following.

Build Output1

Manifest merger failed : Attribute application@fullBackupContent value=(string) from AndroidManifest.xml

To fix this error,

  • add xmlns:tools="http://schemas.android.com/tools" to the <manifest> tag

  • add tools:replace="android:fullBackupContent" to the <application> tag

in the Custom Main Manifest(Assets/Plugins/Android/AndroidManifest.xml) file.

Fix conflict with dataExtractionRules="string resource"

Adding android:dataExtractionRules="string resource" to the AndroidManifest.xml file may cause an error like the following.

Build Output12

Manifest merger failed : Attribute application@dataExtractionRules value=(string resource) from AndroidManifest.xml

To fix this error,

  • add xmlns:tools="http://schemas.android.com/tools" to the <manifest> tag

  • add tools:replace="android:dataExtractionRules" to the <application> tag

in the Custom Main Manifest(Assets/Plugins/Android/AndroidManifest.xml) file.

Fix conflict with allowBackup="false"

Adding android:allowBackup="false" to the AndroidManifest.xml file may cause an error like the following.

Build Output123

Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:32:9-36
	is also present at [:airbridge] AndroidManifest.xml:27:9-35 value=(true).
	Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:30:5-250:19 to override.

To fix this error,

  • add xmlns:tools="http://schemas.android.com/tools" to the <manifest> tag

  • add tools:replace="android:allowBackup" to the <application> tag

in the Custom Main Manifest(Assets/Plugins/Android/AndroidManifest.xml) file.

If compileSdkVersion is lower than 31

The android:dataExtractionRules has been added in API Level 31. Therefore, if the compileSdkVersion is lower than 31, an error like the following may occur.

Build Output1

AndroidManifest.xml: AAPT: error: attribute android:dataExtractionRules not found.

To fix this error,

  • add xmlns:tools="http://schemas.android.com/tools" to the <manifest> tag

  • add tools:remove="android:dataExtractionRules" to the <application> tag

in the Custom Main Manifest(Assets/Plugins/Android/AndroidManifest.xml) file.

For more guidance, refer to the articles below.

[Android] Resolve Airbridge SDK backup rules merge conflict issue

Issue

If an Airflux SDK backup rule and a backup rule for a different third-party SDK (e.g., AppsFlyer SDK) overlap, you will see the build error below.

123

Attribute application@fullBackupContent value=(@xml/appsflyer_backup_rules) from [com.appsflyer:af-android-sdk:6.6.1] AndroidManifest.xml:14:18-73
is also present at [io.airbridge:sdk-android:2.14.0] AndroidManifest.xml:27:18-78 value=(@xml/airbridge_auto_backup_rules).
Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:7:5-13:19 to override.

Cause

Overlapping of the Airflux SDK backup rules and third-party SDK backup rules can cause build errors.

Solution

backup_rules.xml setup

  1. Create an Android Library project (Assets/Plugins/Android/res.androidlib) to store your resource files.

  2. Add an AndroidManifest.xml file in the created Android Library Project as follows.

    123456

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
              package="custom.android.res"
              android:versionCode="1"
              android:versionName="1.0">
    </manifest>
  3. Create a res/xml folder inside the created Android Library Project.

  4. Create a file (e.g., custom_backup_rules.xml) within the new xml folder.

  5. Add the data backup rules defined by the Airflux SDK as follows.

    12345678910111213141516

    <?xml version="1.0" encoding="utf-8"?>
    <full-backup-content>
        <!-- Airbridge Backup Rules -->
        <exclude domain="sharedpref" path="airbridge-internal" />
        <exclude domain="sharedpref" path="airbridge-install" />
        <exclude domain="sharedpref" path="airbridge-user-info" />
        <exclude domain="sharedpref" path="airbridge-user-alias" />
        <exclude domain="sharedpref" path="airbridge-user-attributes" />
        <exclude domain="sharedpref" path="airbridge-device-alias" />
        <exclude domain="database" path="airbridge.db" />
      
        <!-- Appsflyer Backup Rules -->
        <exclude domain="sharedpref" path="appsflyer-data"/>
    	
    	<!-- Your Custom Backup Rules -->
    </full-backup-content>

data_extraction_rules.xml setup

  1. Create a file (e.g., custom_data_extraction_rules.xml) within the new xml folder.

  2. Add the data backup rules defined by the Airflux SDK as follows.

    123456789101112131415161718192021222324252627282930313233

    <?xml version="1.0" encoding="utf-8"?>
    <data-extraction-rules>
        <cloud-backup>
            <!-- Airbridge Backup Rules -->
            <exclude domain="sharedpref" path="airbridge-internal" />
            <exclude domain="sharedpref" path="airbridge-install" />
            <exclude domain="sharedpref" path="airbridge-user-info" />
            <exclude domain="sharedpref" path="airbridge-user-alias" />
            <exclude domain="sharedpref" path="airbridge-user-attributes" />
            <exclude domain="sharedpref" path="airbridge-device-alias" />
            <exclude domain="database" path="airbridge.db" />
    
            <!-- Appsflyer Backup Rules -->
            <exclude domain="sharedpref" path="appsflyer-data"/>
    
    	    <!-- Your Custom Backup Rules -->
        </cloud-backup>
        <device-transfer>
            <!-- Airbridge Backup Rules -->
            <exclude domain="sharedpref" path="airbridge-internal" />
            <exclude domain="sharedpref" path="airbridge-install" />
            <exclude domain="sharedpref" path="airbridge-user-info" />
            <exclude domain="sharedpref" path="airbridge-user-alias" />
            <exclude domain="sharedpref" path="airbridge-user-attributes" />
            <exclude domain="sharedpref" path="airbridge-device-alias" />
            <exclude domain="database" path="airbridge.db" />
    
            <!-- Appsflyer Backup Rules -->
            <exclude domain="sharedpref" path="appsflyer-data"/>
    
    	    <!-- Your Custom Backup Rules -->
        </device-transfer>
    </data-extraction-rules>

AndroidManifest.xml setup

Apply the data backup rules to the Android App Manifest file (Assets/Plugins/Android/AndroidManifest.xml) as follows.

12345678910

<manifest
    ...
    xmlns:tools="http://schemas.android.com/tools">

    <application
        ...
		android:allowBackup="true"
		android:fullBackupContent="@xml/custom_backup_rules"
        android:dataExtractionRules="@xml/custom_data_extraction_rules"
		tools:replace="android:fullBackupContent, android:dataExtractionRules">

For more guidance, refer to the articles below.

Currently, Airflux cannot be used in environments where ADID collection is not allowed. For further discussion or support regarding the use of Airflux in environments with ADID collection restrictions, such as children's apps, contact us at .

If the kotlinx-coroutines-core library version is 1.3.5 or later, .

Airflux Unity SDK package file
[email protected]
the kotlin-stdlib library version must be at a certain level or later
Android Developers Guide
Import an Android Library Project
Override the Android App Manifest