SDK Migration - Android SDK

    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.

    Airbridge Interface


    Summary

    Unit

    initializeSDK(app: Application, config: AirbridgeOption)

    Initializes the SDK with the provided app and AirbridgeOption.

    Unit

    enableSDK()

    Enables the SDK.

    Unit

    disableSDK()

    Disables the SDK.

    Boolean

    isSDKEnabled()

    Checks whether the SDK is currently enabled.

    Unit

    startTracking()

    Starts collecting and transferring events.

    Unit

    setDeviceAlias(key: String, value: String)

    Sets the key, value pair to the device alias.

    Unit

    removeDeviceAlias(key: String)

    Removes the device alias with the given key.

    Unit

    clearDeviceAlias()

    Clears all device aliases.

    Unit

    setUserID(String)

    Sets the user ID.

    Unit

    setUserEmail(String)

    Sets the user email.

    Unit

    setUserPhone(String)

    Sets the user phone number.

    Unit

    setUserAttribute(key: String, value: Int)

    Sets the key and value pair to the user attribute.

    Unit

    setUserAttribute(key: String, value: Long)

    Sets the key and value pair to the user attribute.

    Unit

    setUserAttribute(key: String, value: Float)

    Sets the key and value pair to the user attribute.

    Unit

    setUserAttribute(key: String, value: Double)

    Sets the key and value pair to the user attribute.

    Unit

    setUserAttribute(key: String, value: Boolean)

    Sets the key and value pair to the user attribute.

    Unit

    setUserAttribute(key: String, value: String)

    Sets the key and value pair to the user attribute.

    Unit

    removeUserAttribute(key: String)

    Removes the user attribute with the given key.

    Unit

    clearUserAttributes()

    Clears all user attributes.

    Unit

    setUserAlias(key: String, value: String)

    Sets the key and value pair to the user alias.

    Unit

    removeUserAlias(key: String)

    Removes the user alias with the given key.

    Unit

    clearUserAlias()

    Clears all user aliases.

    Unit

    clearUser()

    Clears all user information.

    Unit

    registerPushToken(token: String)

    Registers the FCM registration token to track app uninstalls.

    Boolean

    isUninstallTrackingNotification(RemoteMessage)

    Silent notifications are sent without any data. However, the notification may be shown to the user depending on the onMessageReceived settings. This determines whether it is a push notification to track uninstalls.

    Unit

    trackEevnt(category: String, semanticAttributes: Map<String, Any> = null, customAttributes: Map<String, Any> = null)

    Tracks events.

    Boolean

    handleDeeplink(intent: Intent, onSuccess: OnSuccess<Uri>, onFailure: OnFailure? = null)

    Handles Airbridge's deep links from the provided intent and invokes a callback based on the result.

    Boolean

    handleDeferredDeeplink(onSuccess: OnSuccess<Uri?>, onFailure: OnFailure? = null)

    Handles deferred deep links and invokes a callback based on the result.

    Boolean

    click(trackingLink: URL, onSuccess: OnSuccess<Unit>, onFailure: OnFailure? = null)

    Queries the tracking link to the server to get the deep link information and then moves according to that information if a deep link is set up. It also adds a click event for the tracking link.

    Boolean

    impression(trackingLink: String, onSuccess: OnSuccess<Unit>, onFailure: OnFailure? = null)

    Adds an impression event for the tracking link.

    Unit

    setWebInterface(webView: WebView, webToken: String)

    Enables the Android SDK to automatically pull all events from the Web SDK that is installed on the website of the WebView environment.

    Boolean

    fetchDeviceUUID(onSuccess: OnSuccess<String>, onFailure: OnFailure? = null)

    Fetches the Device UUID using the provided callbacks for success and failure.

    Boolean

    fetchGoogleInstallReferrerDetails(onSuccess: OnSuccess<ReferrerDetails?>, onFailure: OnFailure? = null)

    Fetches the Google Install Referrer.

    Boolean

    fetchHuaweiInstallReferrerDetails(onSuccess: OnSuccess<ReferrerDetails?>, onFailure: OnFailure? = null)

    Fetched the Huawei Install Referrer.

    Boolean

    fetchOneStoreInstallReferrerDetails(onSuccess: OnSuccess<ReferrerDetails?>, onFailure: OnFailure? = null)

    Fetchs the Onestore Install Referrer.

    Boolean

    fetchGalaxyStoreInstallReferrerDetails(onSuccess: OnSuccess<ReferrerDetails?>, onFailure: OnFailure? = null)

    Fetches the Galaxy Store Install Referrer.

    Boolean

    fetchMetaInstallReferrerDetails(onSuccess: OnSuccess<ReferrerDetails?>, onFailure: OnFailure? = null)

    Fetches the Meta Install Referrer.

    Boolean

    fetchGoogleAdvertisingIdInfo(onSuccess: OnSuccess<AdvertisingIdInfo>, onFailure: OnFailure? = null)

    Fetches the Google Advertising ID info.

    Boolean

    fetchHuaweiAdvertisingIdInfo(onSuccess: OnSuccess<AdvertisingIdInfo>, onFailure: OnFailure? = null)

    Fetches the Huawei Advertising ID info.

    Deprecated Interface

    Unit

    init(app: Application, config: AirbridgeConfig)

    This method was deprecated in v4.

    use initializeSDK(Application, AirbridgeOption) instead

    AirbridgeDeviceInfo

    getDeviceInfo()

    This method was deprecated in v4.

    use setDeviceAlias(String, String)instead
    use removeDeviceAlias(String) instead
    use clearDeviceAlias() instead
    use fetchDeviceUUID(OnSuccess<String>, OnFailure?) instead
    use fetchGoogleInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchHuaweiInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchOneStoreInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchGalaxyStoreInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchMetaInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchGoogleAdvertisingIdInfo(OnSuccess<AdvertisingIdInfo>, OnFailure?) instead
    use fetchHuaweiAdvertisingIdInfo(OnSuccess<AdvertisingIdInfo>, OnFailure?) instead

    AirbridgeUser

    getCurrentUser()

    This method was deprecated in v4.

    use setUserID(String) instead
    use setUserEmail(String) instead
    use setUserPhone(String) instead
    use setUserAttribute(String, Int) instead
    use setUserAttribute(String, Long)instead
    use setUserAttribute(String, Float) instead
    use setUserAttribute(String, Double) instead
    use setUserAttribute(String, Boolean) instead
    use setUserAttribute(String, String) instead
    use removeUserAttribute(String) instead
    use clearUserAttributes() instead
    use setUserAlias(String, String) instead
    use removeUserAlias(String) instead
    use clearUserAlias() instead

    Unit

    expireUser()

    This method was deprecated in v4.

    use clearUser() instead

    Unit

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

    This method was removed in v4.

    use trackEvent(String, Map<String, Any>?, Map<String, Any>?) instead

    Unit

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

    This method was deprecated in v4.

    use trackEvent(String, Map<String, Any>?, Map<String, Any>?) instead

    Unit

    trackEvent(event: Event)

    This method was deprecated in v4.

    use trackEvent(String, Map<String, Any>?, Map<String, Any>?) instead

    Unit

    getDeeplink(intent: Intent, callback: AirbridgeCallback<Uri>)

    This method was deprecated in v4.

    use handleDeeplink(Intent, OnSuccess<Uri>, OnFailure?) instead

    Unit

    click(trackingLink: String, callback: AirbridgeCallback<Boolean>? = null)

    This method was deprecated in v4.

    use click(String, OnSuccess<Unit>, OnFailure?) instead

    Unit

    impression(trackingLink: String)

    This method was deprecated in v4.

    use impression(String, OnSuccess<Unit>, OnFailure?) instead

    Unit

    setJavascriptInterface(webView: WebView, webToken: String)

    This method was deprecated in v4.

    use setWebInterface(WebView, String) instead

    Class changes


    Added

    Class name

    Description

    AirbridgeOption

    initializeSDK(Application, AirbridgeOption) 에서 사용하는 Option class

    AirbridgeCategory

    Key of Standard Event used on trackEvent(String, Map<String, Any>?, Map<String, Any>?)

    AirbridgeAttributes

    Key of Semantic Attribute used on trackEvent(String, Map<String, Any>?, Map<String, Any>?)

    OnSuccess

    OnSuccess callback

    OnFailure

    OnFailure callback

    AirbridgeLogLevel

    Airbridge log level

    Hidden

    Class name

    Description

    Event

    This class was hidden in v4.

    use trackEvent(String, Map<String, Any>?, Map<String, Any>?) instead

    Removed

    Class name

    Description

    AirbridgeConfig

    This class was removed in v4.

    use setWebInterface(WebView, String) instead

    StandardEventCategory

    This class was removed in v4.

    use AirbridgeCategory instead

    SemanticAttributes

    This class was removed in v4.

    use AirbridgeAttributes instead

    Product

    This class was removed in v4.

    use AirbridgeAttributes instead

    AirbridgeCallback

    This class was removed in v4.

    use OnSuccess<T>, OnFailure instead

    OnDeferredDeeplinkReceiveListener

    This class was removed in v4.

    use handleDeferredDeeplink(OnSuccess<T>, OnFailure) instead

    OnDeferredDeeplinkDetermineListener

    This class was removed in v4.

    AirbridgeDeviceInfo

    This method was removed in v4.

    use setDeviceAlias(String, String) instead
    use removeDeviceAlias(String) instead
    use clearDeviceAlias() instead
    use fetchDeviceUUID(OnSuccess<String>, OnFailure?) instead
    use fetchGoogleInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchHuaweiInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchOneStoreInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchGalaxyStoreInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchMetaInstallReferrerDetails(OnSuccess<ReferrerDetails?>, OnFailure?) instead
    use fetchGoogleAdvertisingIdInfo(OnSuccess<AdvertisingIdInfo>, OnFailure?) instead
    use fetchHuaweiAdvertisingIdInfo(OnSuccess<AdvertisingIdInfo>, OnFailure?) instead

    AirbridgeUser

    This method was removed in v4.

    use setUserID(String) instead
    use setUserEmail(String) instead
    use setUserPhone(String) instead
    use setUserAttribute(String, Int) instead
    use setUserAttribute(String, Long) instead
    use setUserAttribute(String, Float) instead
    use setUserAttribute(String, Double) instead
    use setUserAttribute(String, Boolean) instead
    use setUserAttribute(String, String) instead
    use removeUserAttribute(String) instead
    use clearUserAttributes() instead
    use setUserAlias(String, String) instead
    use removeUserAlias(String) instead
    use clearUserAlias() instead

    Moved

    Class name

    Description

    AdvertisingIdInfo

    Moved to co.ab180.airbridge.common package

    ReferrerDetails

    Moved co.ab180.airbridge.common package

    AirbridgeOption


    AirbridgeConfig

    AirbridgeOption

    default value

    constructor(String, String)

    constructor(String, String)

    -

    setSDKSignatureSecret(String, String)

    setSDKSignatureSecret(String, String)

    -

    setLogLevel(int)

    setLogLevel(AirbridgeLogLevel)

    AirbridgeLogLevel.WARNING

    setSessionTimeoutSeconds(Long)

    setSessionTimeout(Long)

    300

    setUserInfoHashEnabled(Boolean)

    setHashUserInformationEnabled(Boolean)

    true

    setAutoStartTrackingEnabled(Boolean)

    setAutoStartTrackingEnabled(Boolean)

    true

    setTrackAirbridgeLinkOnly(Boolean)

    setTrackAirbridgeDeeplinkOnlyEnabled(Boolean)

    false

    setTransmitEventOnBackgroundEnabled(Boolean)

    setPauseEventTransmitOnBackgroundEnabled(Boolean)

    false

    setLocationCollectionEnabled(Boolean)

    setCollectLocationEnabled(Boolean)

    false

    setFacebookDeferredAppLinkEnabled(Boolean)

    setTrackMetaDeferredAppLinkEnabled(Boolean)

    false

    setErrorLogCollectionEnabled(Boolean)

    setErrorLogCollectionEnabled(Boolean)

    true

    setResetEventBufferEnabled(Boolean)

    setClearEventBufferOnInitializeEnabled(Boolean)

    false

    setSdkEnabled(Boolean)

    setSdkEnabled(Boolean)

    true

    setAppMarketIdentifier(String)

    setAppMarketIdentifier(String)

    “”

    setPlatform(String)

    setSDKDevelopmentPlatform(String)

    “native”

    setEventMaximumBufferCount(Int)

    setEventBufferCountLimit(Int)

    Int.MAX_VALUE

    setEventMaximumBufferSize(Long)

    setEventBufferSizeLimit(Long)

    Long.MAX_VALUE

    setEventTransmitInterval(Long)

    setEventTransmitInterval(Long)

    0

    setCustomDomains(List<String>)

    setCustomDomains(List<String>)

    emptyList()

    setOnDeferredDeeplinkReceiveListener(OnDeferredDeeplinkReceiveListener)

    remove

    -

    setOnDeferredDeeplinkDetermineListener(OnDeferredDeeplinkDetermineListener)

    remove

    -

    setOnAttributionResultReceiveListener(OnAttributionResultReceiveListener)

    setOnAttributionReceived(OnAttributionResultReceiveListener)

    null

    setFacebookOnDeviceAttribution(String)

    setMetaInstallReferrer(String)

    null

    setLifecycleIntegration(AirbridgeLifecycleIntegration)

    setLifecycleIntegration(AirbridgeLifecycleIntegration)

    null

    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)
    }
    1234567
    @Override
    public void onCreate() {
        super.onCreate();
        AirbridgeOption option = new 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 = { }
    )
    12345
    boolean result = Airbridge.handleDeeplink(
            intent,
            uri -> { },
            throwable -> { }
    );

    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.

    • You can call handleDeeplink and its value from the activity configuration.

    • You can check with the result value whether the deferred deep links can be handled.

    • Deferred deep links are designed to be acquired only once after the app install. If the value is already acquired or called first, the result is false.

    1234
    val result = Airbridge.handleDeferredDeeplink(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.handleDeferredDeeplink(
            uri -> { },
            throwable -> { }
    );

    Set up custom domain

    The method of specifying custom domain URLs in the res/values/airbridge.xml

    file, used in version 2.x, has been changed. You can now add custom domain links by using the setTrackingLinkCustomDomains function during Airbridge SDK initialization.

    1234567
    // YOUR_APP_NAME: input your app name
    // YOUR_APP_SDK_TOKEN: input your app token
    // YOUR_APP_CUSTOM_DOMAIN: input your app custom domain. ex) example.domain.com
    val option = AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
        .setTrackingLinkCustomDomains(listOf("YOUR_APP_CUSTOM_DOMAIN"))
        .build()
    Airbridge.initializeSDK(this, option)
    1234567
    // YOUR_APP_NAME: input your app name
    // YOUR_APP_SDK_TOKEN: input your app token
    // YOUR_APP_CUSTOM_DOMAIN: input your app custom domain. ex) example.domain.com
    AirbridgeOption option = new AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
        .setTrackingLinkCustomDomains(Arrays.asList("YOUR_APP_CUSTOM_DOMAIN"))
        .build();
    Airbridge.initializeSDK(this, option);

    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.

    Key

    Data

    SIGN_UP

    airbridge.user.signup

    SIGN_IN

    airbridge.user.signin

    SIGN_OUT

    airbridge.user.signout

    HOME_VIEWED

    airbridge.ecommerce.home.viewed

    PRODUCT_LIST_VIEWED

    airbridge.ecommerce.productList.viewed

    SEARCH_RESULTS_VIEWED

    airbridge.ecommerce.searchResults.viewed

    PRODUCT_VIEWED

    airbridge.ecommerce.product.viewed

    ADD_PAYMENT_INFO

    airbridge.addPaymentInfo

    ADD_TO_WISHLIST

    airbridge.addToWishlist

    ADDED_TO_CART

    airbridge.ecommerce.product.addedToCart

    INITIATE_CHECKOUT

    airbridge.initiateCheckout

    ORDER_COMPLETED

    airbridge.ecommerce.order.completed

    ORDER_CANCELED

    airbridge.ecommerce.order.canceled

    START_TRIAL

    airbridge.startTrial

    SUBSCRIBE

    airbridge.subscribe

    UNSUBSCRIBE

    airbridge.unsubscribe

    AD_IMPRESSION

    airbridge.adImpression

    AD_CLICK

    airbridge.adClick

    COMPLETE_TUTORIAL

    airbridge.completeTutorial

    ACHIEVE_LEVEL

    airbridge.achieveLevel

    UNLOCK_ACHIEVEMENT

    airbridge.unlockAchievement

    RATE

    airbridge.rate

    SHARE

    airbridge.share

    SCHEDULE

    airbridge.schedule

    SPEND_CREDITS

    airbridge.spendCredits

    Key

    Data

    Data type

    ACTION

    action

    string

    LABEL

    label

    string

    VALUE

    value

    float

    CURRENCY

    currency

    string

    PRODUCTS

    products

    array

    PRODUCT_ID

    productID

    string

    PRODUCT_NAME

    name

    string

    PRODUCT_PRICE

    price

    float

    PRODUCT_QUANTITY

    quantity

    int

    PRODUCT_CURRENCY

    currency

    string

    PRODUCT_POSITION

    position

    int

    PRODUCT_CATEGORY_ID

    categoryID

    string

    PRODUCT_CATEGORY_NAME

    categoryName

    string

    PRODUCT_BRAND_ID

    brandID

    string

    PRODUCT_BRAND_NAME

    brandName

    string

    PERIOD

    period

    string

    IS_RENEWAL

    isRenewal

    boolean

    RENEWAL_COUNT

    renewalCount

    int

    PRODUCT_LIST_ID

    productListID

    string

    CART_ID

    cartID

    string

    TRANSACTION_ID

    transactionID

    string

    TRANSACTION_TYPE

    transactionType

    string

    TRANSACTION_PAIRED_EVENT_CATEGORY

    transactionPairedEventCategory

    string

    TRANSACTION_PAIRED_EVENT_TIMESTAMP

    transactionPairedEventTimestamp

    int

    TOTAL_QUANTITY

    totalQuantity

    int

    QUERY

    query

    string

    IN_APP_PURCHASED

    inAppPurchased

    boolean

    CONTRIBUTION_MARGIN

    contributionMargin

    float

    LIST_ID

    listID

    string

    RATE_ID

    rateID

    string

    RATE

    rate

    float

    MAX_RATE

    maxRate

    float

    ACHIEVEMENT_ID

    achievementID

    string

    SHARED_CHANNEL

    sharedChannel

    string

    DATE_TIME

    datetime

    string

    DESCRIPTION

    description

    string

    IS_REVENUE

    isRevenue

    boolean

    PLACE

    place

    string

    SCHEDULE_ID

    scheduleID

    string

    TYPE

    type

    string

    LEVEL

    level

    string

    SCORE

    score

    float

    AD_PARTNERS

    adPartners

    array

    IS_FIRST_PER_USER

    isFirstPerUser

    boolean

    123456789101112131415161718192021222324252627
    Airbridge.trackEvent(
        AirbridgeCategory.ORDER_COMPLETED,
        mapOf(
            // action
            AirbridgeAttribute.ACTION to "Tool",
            // label
            AirbridgeAttribute.LABEL to "Hammer",
            // value
            AirbridgeAttribute.VALUE to 10,
            // semantic attribute (provided by sdk)
            AirbridgeAttribute.CURRENCY to "USD",
            AirbridgeAttribute.PRODUCTS to listOf(
                mapOf(
                    // semantic attribute value (provided by sdk)
                    AirbridgeAttribute.PRODUCT_ID to "12345",
                    // semantic attribute value (not provided by sdk)
                    "name" to "PlasticHammer",
                ),
            ),
            // semantic attribute (not provided by sdk)
            "totalQuantity" to 1,
        ),
        mapOf(
            // custom attribute
            "promotion" to "FirstPurchasePromotion",
        )
    )
    12345678910111213141516171819202122232425262728
    Airbridge.trackEvent(
            AirbridgeCategory.ORDER_COMPLETED,
            new HashMap() {{
                // action
                put(AirbridgeAttribute.ACTION, "Tool");
                // label
                put(AirbridgeAttribute.LABEL, "Hammer");
                // value
                put(AirbridgeAttribute.VALUE, 10);
                // semantic attribute (provided by sdk)
                put(AirbridgeAttribute.CURRENCY, "USD");
                put(AirbridgeAttribute.PRODUCTS, Arrays.asList(
                    new HashMap() {{
                        // semantic attribute value (provided by sdk)
                        put(AirbridgeAttribute.PRODUCT_ID, "12345");
                        // semantic attribute value (not provided by sdk)
                        put("name", "PlasticHammer");
                    }}
                ));
                // semantic attribute (not provided by sdk)
                put("totalQuantity", 1);
                
            }},
            new HashMap() {{
                // custom attribute
                put("promotion", "FirstPurchasePromotion");
            }}
    );

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

    Instead of accessing the code through Airbridge.getUserInfo(), you need to replace it with the following Airbridge interface.

    123456789101112131415161718
    fun setUserID(id: String)
    fun setUserEmail(email: String)
    fun setUserPhone(phone: String)
    
    fun setUserAttribute(key: String, value: Int)
    fun setUserAttribute(key: String, value: Long)
    fun setUserAttribute(key: String, value: Float)
    fun setUserAttribute(key: String, value: Double)
    fun setUserAttribute(key: String, value: Boolean)
    fun setUserAttribute(key: String, value: String)
    fun removeUserAttribute(key: String)
    fun clearUserAttributes()
    
    fun setUserAlias(key: String, value: String)
    fun removeUserAlias(key: String)
    fun clearUserAlias()
    
    fun clearUser()
    123456789101112131415161718
    void setUserID(String id)
    void setUserEmail(String email)
    void setUserPhone(String phone)
    
    void setUserAttribute(String key, int value)
    void setUserAttribute(String key, long value)
    void setUserAttribute(String key, float value)
    void setUserAttribute(String key, double value)
    void setUserAttribute(String key, boolean value)
    void setUserAttribute(String key, String value)
    void removeUserAttribute(String key)
    void clearUserAttributes()
    
    void setUserAlias(String key, String value)
    void removeUserAlias(key: String)
    void clearUserAlias()
    
    void clearUser()

    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.

    You need to replace the codes that enables access through Airbridge.getDeviceInfo() with the following Airbridge interface.

    Device UUID

    1234
    val result = Airbridge.fetchDeviceUUID(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchDeviceUUID(
            uuid -> { },
            throwable -> { }
        );

    Install referrer

    fetch Google Install referrer

    1234
    val result = Airbridge.fetchGoogleInstallReferrerDetails(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchGoogleInstallReferrerDetails(
            referrerDetails -> { },
            throwable -> { }
    );

    fetch Huawei Install referrer

    1234
    val result = Airbridge.fetchHuaweiInstallReferrerDetails(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchHuaweiInstallReferrerDetails(
            referrerDetails -> { },
            throwable -> { }
        );

    fetch Galaxy store Install referrer

    1234
    val result = Airbridge.fetchGalaxyStoreInstallReferrerDetails(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchGalaxyStoreInstallReferrerDetails(
            referrerDetails -> { },
            throwable -> { }
        );

    fetch Meta Install referrer

    1234
    val result = Airbridge.fetchMetaInstallReferrerDetails(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchMetaInstallReferrerDetails(
            referrerDetails -> { },
            throwable -> { }
        );

    Advertising ID

    fetch Google Advertising ID

    1234
    val result = Airbridge.fetchGoogleAdvertisingIdInfo(
        onSuccess = { },
        onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchGoogleAdvertisingIdInfo(
            advertisingIdInfo -> { },
            throwable -> { }
        );

    fetch Huawei Advertising ID

    1234
    val result = Airbridge.fetchHuaweiAdvertisingIdInfo(
    	onSuccess = { },
    	onFailure = { }
    )
    1234
    boolean result = Airbridge.fetchHuaweiAdvertisingIdInfo(
            advertisingIdInfo -> { },
            throwable -> { }
        );

    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)
        }
    }
    123456789101112131415
    class App extends Application {
        
        @Override
        public void onCreate() {
            super.onCreate();
            
            Airbridge.initializeSDK(this,
                    new AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
                            .setOnAttributionReceived(result -> {
                                // do something
                            })
                            .build()
                    );
        }
    }

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

    click

    12345
    fun click(
        trackingLink: String,
        onSuccess: OnSuccess<Unit>? = null,
        onFailure: OnFailure? = null
    ): Boolean
    12345
    boolean click(
        @NonNull String trackingLink,
        @Nullable OnSuccess<Unit> onSuccess,
        @Nullable OnFailure onFailure
    )

    impression

    12345
    fun impression(
        trackingLink: String,
        onSuccess: OnSuccess<Unit>? = null,
        onFailure: OnFailure? = null
    ): Boolean
    12345
    boolean impression(
        @NonNull String trackingLink,
        @Nullable OnSuccess<Unit> onSuccess,
        @Nullable OnFailure onFailure
    )

    Hybrid app integration

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

    1
    Airbridge.setWebInterface(webview, "YOUR_WEB_TOKEN")
    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 apps registered with Airbridge 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.

    • BACKGROUND events have been removed.

    v2.18.0

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

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

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