Package 

Class BranchMigrationManagerImpl

    • Method Detail

      • addLatdDataToConversion

         Unit addLatdDataToConversion(AFEvent conversionEvent)

        Adds LATD data to a Conversion Event if available. Assigns the true result to the hasLatdDataBeenAddedToConversionEvent property. This allows further use of the fetched LATD data, such as determining whether to trigger an Attr event.

        Parameters:
        conversionEvent - the Conversion event to which LATD data will be added.
      • addLatdDataToAttr

         Unit addLatdDataToAttr(AFEvent attrEvent)

        Adds LATD to the given Attr event if available.

        This function performs the following:

        • If attrLatdData is not null, it indicates that LATD data was already fetched when triggerAttrIfNeeded was called earlier. In this case, the data is directly added to the event.

        • If attrLatdData is null, it attempts to fetch LATD data within a 3-second timeout (FETCH_LATD_TIMEOUT). If data is successfully fetched and is not null, it is added to the event.

        Parameters:
        attrEvent - the Attr event (AFEvent) to which LATD data will be added if available.
      • triggerAttrIfNeeded

         Unit triggerAttrIfNeeded(SendLaunchTask finishedTask, Function0<Unit> triggerAttrCallback)

        Triggers an attribution (Attr) event if specific conditions are met.

        This method evaluates the following conditions to determine if the Attr event should be triggered:

        • The current launch is the first launch (launchCounter equals 1).

        • The provided task (finishedTask) is of type CONVERSION.

        • All referrers have been collected (as indicated by the referrersManager.hasStartedReferrers() check returning false).

        • LATD data has not already been added to Conversion Event (hasLatdDataBeenAddedToConversionPayload() returns false).

        If all conditions are satisfied, the method waits for LATD data to be fetched within a specified timeout (FETCH_LATD_TIMEOUT). If LATD data is received and is not null, the data is assigned to latdData, and the triggerAttrCallback function is invoked.

        Parameters:
        finishedTask - the completed task to evaluate.
        triggerAttrCallback - a callback function to be executed if the Attr event is triggered.
      • reset

         Unit reset()

        Sets the shouldAddBranchDeepLinkData flag false. Also clears collected data in Migration helper. Should be called when app onBecameBackground().

      • checkIfShouldAddBranchDeeplinkData

         Unit checkIfShouldAddBranchDeeplinkData(Intent intent, AFDeepLinkManager deeplinkManager)

        Determines whether Branch deeplink data should be collected for the next launch event based on the incoming Intent's Uri.

        • If Migration helper already has deeplinkg data - shouldAddBranchDeepLinkData will be set to true.

        • If intent.data is null, this method immediately returns and Branch deeplink data will not be collected.

        • If intent.data is non-null, the URI is checked against OneLinkValidator. If it’s identified as a branded (customDomain) or OneLink (isOneLink == true OR isBranded == true), Branch data is not collected. Otherwise, shouldAddBranchDeepLinkData is set to true.

        As long as the final Activity receives a non-null URI that isn’t recognized as a OneLink or customDomain (Branded), Branch data collection is enabled. If the URI is null, we skip collecting Branch data entirely.

        Parameters:
        intent - The Intent that may carry a deeplink Uri.
        deeplinkManager - Reference to the AppsFlyer deep link manager, used by OneLinkValidator.
      • addBranchDeeplinkDataToLaunch

         Unit addBranchDeeplinkDataToLaunch(AFEvent launchEvent)

        Adds Branch's DeeplinkingData to the given launch event if data is available.

        Parameters:
        launchEvent - the launch event to which the data will be added.