SDK Migration - Android SDK (v4)

    This article contains the information required to update the Airbridge Android SDK. We recommend checking the information regarding all versions.

    Update from v2.x to v4.0

    Check the information below when updating the Airbridge Android SDK to v4.0. All changes are listed.

    SDK Initialization

    Airbridge.init(Application, AirbridgeConfig) has been changed to Airbridge.initializeSDK(Application, AirbridgeOption).

    AirbridgeConfig has been changed to AirbridgeOption. AirbridgeConfig.Builderhas been changed to AirbridgeOptionBuilder. Some function names in the AirbridgeOptionBuilder have been changed or deleted.

    Refer to the example below.

    123456
    override fun onCreate() {
        super.onCreate()
        val option = AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
            .build()
        Airbridge.initializeSDK(this, option)
    }

    The function name has been changed from getDeeplink() to handleDeeplink(). AirbridgeCallback has been removed. The OnSuccess and OnFailure listener have been added. You can check whether the function worked by its return value.

    12345
    val result = Airbridge.handleDeeplink(
        intent = intent
        onSuccess = { },
        onFailure = { }
    )

    We have improved the existing deferred deep link code logic that adds a listener to make screen transitions more convenient. The previous method of adding a listener has been removed. Instead, you can receive deferred deep links through the Airbridge interface.

    In-app events and user data

    The following APIs have been deleted. Also, StandardEventCategory, SemanticAttributes, and Product have been removed.

    • trackEvent(category: StandardEventCategory, action: String? = null, label: String? = null, value: Number? = null, customAttributes: Map<String, Any?>? = null, semanticAttributes: Map<String, Any?>? = null)

    • trackEvent(category: String, action: String? = null, label: String? = null, value: Number? = null, customAttributes: Map<String, Any?>? = null, semanticAttributes: Map<String, Any?>? = null)

    • trackEvent(event: Event)

    New APIs have been added.

    • trackEvent(category: String, semanticAttributes: Map<String, Any>? = null, customAttributes: Map<String, Any>? = null)

    • AirbridgeCategory has been added. The event category string is predefined.

    • The function override and objects (SemanticAttributes, Product) for passing additional information were deleted.

    • Instead, it has been modified to transmit attributes through a map. The key value of the map is predefined in AirbridgeAttribute as a string. Custom attributes can be sent directly as a string.

    Refer to the AirbridgeCategory, AirbridgeAttribute mapping and trackEvent function below.

    AirbridgeUser has been deleted. You can now access the interface through the Airbridge interface that was previously accessible through AirbridgeUser.

    AirbridgeDeviceInfo has been deleted. The interface that was accessed through AirbridgeDeviceInfo has been modified so that it can now be accessed through the Airbridge interface.

    AirbridgeCallback has been deleted and OnSuccess, OnFailure listener has been added. You can receive the success status through this listener.

    AirbridgeDeviceInfo has been deleted. There is no function to receive the attribution result through the Airbridge interface. However, it can be received through the listener of AirbridgeOption, which is an existing method.

    123456789101112
    class App : Application() {
    
        override fun onCreate() {
            super.onCreate()
            val option: AirbridgeOption = AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
                .setOnAttributionReceived { result ->
                    // do something
                }
                .build()
            Airbridge.initializeSDK(this, option)
        }
    }

    AirbridgeCallback has been deleted and OnSuccess, OnFailure listeners have been added. You can check the operation status of the function through the return value.

    Hybrid app integration

    The function name has been changed from setJavascriptInterface() to setWebInterface().

    1
    Airbridge.setWebInterface(webview, "YOUR_WEB_TOKEN")

    Update within v2.x

    This section describes the major changes in each version of the Android SDK.

    v2.24.0

    For Airbridge apps created after September 4, 2023, we’ve resolved the issue where the deep-link URL provided in the deep-link callback was decoding the content entered in the Airbridge dashboard twice.

    This issue occurred in Android SDK from v2.22.0 to v2.23.0.

    v2.21.2

    An initialization option has been added to stop sending events when the app is in the background.

    • You can use the AirbridgeConfig#setTransmitEventOnBackgroundEnabledfunction to stop sending events when the app is in the background.

    • The default value is true. When true, the remaining events are sent even when the app is in the background.

    v2.21.1

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

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

    v2.19.1

    Changes have been made so that ORGANIC_REOPEN, FOREGROUND events that occur within the session time are not collected by default.

    • If you are using a version before v2.19.1 and you are collecting ORGANIC_REOPEN, FOREGROUND events, you can continue collecting these events through AirbridgeConfig#setTrackInSessionLifeCycleEventEnabled.

    • The default value is false, meaning ORGANIC_REOPEN and FOREGROUND events are not collected.

    BACKGROUND events have been removed.

    v2.18.0

    Deeplink Pageview events will only be collected when Airbridge.click is called.

    Was this page helpful?

    Have any questions or suggestions?