2. Install the Airflux SDK

1. SDK Installation

The Airflux SDK can be installed using various dependency management tools. Choose one of the following methods to add the SDK to your project.

  1. In the Xcode menu bar, click [File] > [Add Packages...]

  2. In the top-right search bar, enter the following URL and then click [Add Package].

    https://github.com/ab180/airflux-ios-sdk-deployment

  3. Confirm the detected package and continue to click [Add Package] to complete the installation.

  4. You can confirm that the Airbridge SDK has been added under Package Dependencies in the Project Navigator.


2. SDK Initialization

Initialize the SDK by referring to the code below.

Your YOUR_APP_NAME and YOUR_APP_SDK_TOKEN credentials are available in the Airbridge dashboard via [Settings] > [Token Management].

SDK Option
Method
Data Type
Description
Required

App Name

AirfluxOptionBuilder()

string

Input the App Name from the Airbridge dashboard.

Required

App Token

AirfluxOptionBuilder()

string

Input the App Token from the Airbridge dashboard.

Required

SDK Enabled

setSDKEnabled()

boolean

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 the Airflux.EnableSDK()function.

Optional

Auto Start Tracking Enabled

setAutoStartTrackingEnabled()

boolean

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.

Optional

Log Level

setLogLevel()

AirfluxLogLevel

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

Optional

Session Timeout

setSessionTimeout()

double

The default value is 300 seconds. Modify if needed.

Optional

Allow Every Country Enabled

setAllowEveryCountryEnabled()

boolean

When set to true, all countries are allowed to follow Airflux's optimization policies. To use a specific list of countries, set it to false and provide a list using setCountryAllowlist().

Optional

Country Allowlist

setCountryAllowlist()

List<String>

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. Airflux identifies a country based on the value tied to the device.

Optional

import UIKit
import Airflux

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Creates the option for initializing the Airflux SDK.
        // Replace "YOUR_APP_NAME" and "YOUR_APP_TOKEN" with your actual credentials.
        let option = AirfluxOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_TOKEN")
            // Automatically enables the SDK on startup.
            .setSDKEnabled(true)
            // Automatically starts tracking events.
            .setAutoStartTrackingEnabled(true)
            // Sets the log level to debug for detailed logs.
            .setLogLevel(AirfluxLogLevel.debug)
            // Sets the session timeout to 300 seconds (5 minutes).
            .setSessionTimeout(second: 300)
            // Allows Airflux features in all countries.
            .setAllowEveryCountryEnabled(true)
            // Uncomment the line below to allow only specific countries.
            // .setCountryAllowlist(["US", "KR", "JP"])
            .build()

        // Initializes the SDK with the configured option.
        Airflux.initializeSDK(option: option)
        
        return true
    }
}

3. Verification

iOS Console Log Check

To view detailed log information for your app in Xcode, use the following method before initializing the SDK

4. Frequently Asked Questions

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?

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 the initialization option setAutoStartTrackingEnabled()to false and call the startTracking() function at the point where you have received user consent for data tracking. The Airflux SDK will collect data after the startTracking() function is called.

// 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

Set the initialization option setSDKEnabled() 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.

How can I configure the Airflux SDK to call the Inference API only in specific countries

Set the initialization opeion setAllowEveryCountryEnabled() to false and add the countries you want to allow to 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. Country codes are not case-sensitive.

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

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

How does Airflux determine a user’s country?

Airflux distinguishes a country based on the value tied to the deivce.

Does Airflux collect the ADID (Advertising ID)?

No. The Airflux SDK operates without collecting or requiring the ADID.

Last updated