SDK Migration - iOS SDK (v4)

    You'll find what you need to know about the process of updating the Airbridge iOS SDK. We recommend that you check everything from the current version onwards to the version after the update.

    Update from v1.x to v4.0

    Please update the Airbridge iOS SDK to 4.0 to check.

    iOS SDK name changed from AirBridge to Airbridge. The AirBridge class has been changed to the Airbridge class. Functions and options have been renamed.

    SDK installation and initialization

    The CocoaPods package name, SwiftPackageManager Git address, and direct install download URL have changed. Please delete the existing iOS SDK and reinstall it by following the Airbridge guide.

    The AirBridge.getInstance function used to initialise the SDK has been changed to the Airbridge.initializeSDK function. Also, the option setting functions have been changed to the AirbridgeOption and AirbridgeOptionBuilder classes.

    SDK's options are no longer changed at runtime.Please refer to the mapping below to write your new SDK initialisation code.

    1234567
    import Airbridge
    ...
    let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
        .setLogLevel(.warning)
        .setSessionTimeout(second: 300)
        .build()
    Airbridge.initializeSDK(option: option)

    The AirBridge.setDeeplinkCallback function has been replaced by the Airbridge.handleDeeplink function and handleDeferredDeeplink function.

    AirBridge.deeplink().handle (or handleUniversalLink) and AirBridge.deeplink().handleURLSchemeDeeplink have been replaced by Airbridge.trackDeeplink.

    The method for registering custom domains has changed. Previously, custom domains were added as values to the co.ab180.airbridge.trackingLink.customDomains key in Info.plist.

    The changed method is to add them by calling the setTrackingLinkCustomDomains function during the SDK initialization phase.

    In-app events and user data

    Attention

    Please enter the value in AirbridgeAttribute.VALUE instead of the existing totalValue.

    The logic where totalValue overwrites the value when using setSemantics' totalValue and defining the value with setValue has been removed from SDK v4.

    The ABInAppEvent class has been replaced by the Airbridge.trackEvent function.

    Please follow the guide below to change the ABInAppEvent class and setAction, setLabel, setValue, setSemantics, and setCustoms to the Airbridge.trackEvent function.

    • setCategory: If you are using ABCategory, you should use AirbridgeCategory. If you are using a String, enter it in the category parameter as is.

    • setAction: Enter the AirbridgeAttribute.ACTION key in the semanticAttributes parameter.

    • setLabel: Enter in the AirbridgeAttribute.LABEL key of the semanticAttributes parameter.

    • setValue: Enter in the AirbridgeAttribute.VALUE key of the semanticAttributes parameter.

    • setSemantics: If you are using ABSemanticsKey as the key in the semanticAttributes parameter, useAirbridgeAttribute. If you are using String, enter it as is. The value is entered regardless of the key.

    • setCustoms: In the customAttributes parameter, enter the key and value as they are.

    See AirbridgeCategory, AirbridgeAttribute mapping, and the Airbridge.trackEvent function below.

    AirBridge.setDeviceAlias related functions replaced with AirBridge.setDeviceAlias related functions.

    12345
    import Airbridge
    ...
    Airbridge.setDeviceAlias(key: "string", value: "string")
    Airbridge.removeDeviceAlias(key: "string")
    Airbridge.clearDeviceAlias()

    AirBridge.state().setUser related functions have been replaced with Airbridge.setUser related functions. The setuser function that sets user information at once is not supported.

    1234567891011121314151617181920
    import Airbridge
    ...
    // identifier
    Airbridge.setUserID("string")
    Airbridge.clearUserID()
    // addtional identifier
    Airbridge.setUserAlias(key: "string", value: "string")
    Airbridge.removeUserAlias(key: "string")
    Airbridge.clearUserAlias()
    ...
    // email, phone
    Airbridge.setUserEmail("string")
    Airbridge.clearUserEmail()
    Airbridge.setUserPhone("string")
    Airbridge.clearUserPhone()
    // addtional attribute
    Airbridge.setUserAttribute(key: "string", value: "string")
    Airbridge.setUserAttribute(key: "number", value: 1000)
    Airbridge.removeUserAttribute(key: "string")
    Airbridge.clearUserAttributes()

    Additional settings

    The AirBridge.placement().click function and the AirBridge.placement().impression function have been replaced with the Airbridge.clickfunction and the Airbridge.impression function.

    1234567891011121314151617181920
    import Airbridge
    ...
    let isHandled = Airbridge.click(trackingLink: url) {
        // when url is tracking link and succeed
    } onFailure: { error in
        // when url is tracking link and failed
        // example: url is another app's tracking link, internet is not connected
    }
    if !isHandled {
        // when url is not tracking link
    }
    ...
    let isHandled = Airbridge.impression(trackingLink: url) {
        // when url is tracking link and succeed
    } onFailure: { error in
        // when url is tracking link and failed
    }
    if !isHandled {
        // when url is not tracking link
    }

    AirBridge.webInterface().inject function has been replaced by Airbridge.setWebInterface function.

    123456
    import Airbridge
    ...
    Airbridge.setWebInterface(
        controller: controller,
        webToken: "YOUR_WEB_TOKEN"
    )

    Update within v1.x

    See the major changes in each version of the iOS SDK.

    Airbridge apps created on or after 4 September 2023 resolved an issue where the deeplink URL provided in the deeplink callback would be decoded twice to provide what was entered in the Airbridge Dashboard.This issue occurred in iOS SDK 1.34.0 to 1.35.1.

    Airbridge apps created on or after 4 September 2023 will not append airbridge_referrer to the deep link URL provided in the deeplink callback and will instead pass it to the information entered in the Airbridge Dashboard.

    Clients using Airbridge apps created before 4 September 2023 who require this feature should contact their Airbridge CSM.

    v1.33.0 - SKAdNetwork

    support for SKAdNetwork 4.0, we changed the way conversion values are calculated. When a user updates from an app with iOS SDK 1.33.0 or lower to an app with version 1.33.0 or higher, the last calculated conversion value will be finalized.

    v1.32.1 - User privacy

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

    Was this page helpful?

    Have any questions or suggestions?