-
- All Implemented Interfaces:
-
java.util.concurrent.Callable,kotlin.Comparable
public class SendLaunchTask extends SendEventTask
Sends Launch / Conversion / Attr events to the AppsFlyer backend. This is the main task that produces the install and session payloads used for attribution.
When
launchCounter == 1the event is sent as CONVERSION. The payload includes DDL metrics, first-launch metrics, marketing referrers (Google Play, Meta, Huawei, …), Facebook DDL, and Branch LATD data.When
launchCounter == 2the event is the second app open after install — it can be either a Launch or an Attr. Three things happen at this counter: any non-Google referrer still in STARTED state adds aTIMEOUTentry to RFRS, the first-launch metrics are cleared from the collector (and added to the payload if non-empty), and — for Attr events only — Branch LATD data is added if it was not already included in CONVERSION.Soft dependencies on AppsFlyerTaskType.RESOLVE_ESP and AppsFlyerTaskType.DLSDK make this task wait for those tasks when they are running, so they can add resolved deeplink parameters to the event before it is sent.
At
launchCounter == 1the referrers manager is marked as "conversion prepared" before the referrer list is iterated (DELIVERY-117883). Any referrer callback that finishes after this mark will produce a separate ATTR event instead of being added to the CONVERSION that is currently being sent.shouldRetryextends the parent rules: CONVERSION/ATTR events with a 5xx response are retried so a temporary backend error does not lose attribution data. On completion the task ends launch-request metrics collection and, on success only, recordssessionStorage.lastSuccessfulLaunchTimestamp.If a conversion listener is registered, a GCD (Get Conversion Data) request is then sent. Once on success and once after the first failure, never on subsequent failures so the customer's listener receives
onConversionData*even when there is no internet (RD-87373).
-
-
Field Summary
Fields Modifier and Type Field Description private final Response<String>resultprivate final Set<TaskType>dependenciesprivate final Set<TaskType>softDependenciesprivate final Integerorderprivate LongexecutionTimeprivate ThrowableexecutionErrorprivate volatile IntegerretryCountprivate final TaskTypetype
-
Constructor Summary
Constructors Constructor Description SendLaunchTask(AFEvent event, ServiceLocator serviceLocator)
-
Method Summary
Modifier and Type Method Description Response<String>getResult()final Set<TaskType>getDependencies()final Set<TaskType>getSoftDependencies()final IntegergetOrder()Chronological order in which the task object was created. final LonggetExecutionTime()final UnitsetExecutionTime(Long executionTime)final ThrowablegetExecutionError()Error which happened during task execution, or nullif the task was successful.final UnitsetExecutionError(Throwable executionError)final IntegergetRetryCount()Number of times the task was executed, INCLUDING the initial try. final UnitsetRetryCount(Integer retryCount)final TaskTypegetType()final SendLaunchTasksetFacebookDDLMap(Map<out String, Object> facebookDDLMap)Stores a reference to the Facebook DDL map. final BooleanshouldRetryConversionOrAttr()-
Methods inherited from class com.appsflyer.internal.components.queue.tasks.SendLaunchTask
getLaunchCounter -
Methods inherited from class com.appsflyer.internal.components.queue.tasks.HttpTask
addDependency, addSoftDependency, call, compareTo, equals, executionResult, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SendLaunchTask
SendLaunchTask(AFEvent event, ServiceLocator serviceLocator)
-
-
Method Detail
-
getDependencies
final Set<TaskType> getDependencies()
-
getSoftDependencies
final Set<TaskType> getSoftDependencies()
-
getOrder
final Integer getOrder()
Chronological order in which the task object was created. Required to support natural ordering in the Queue SkipListSet: two tasks of the same type and priority — the first one has the smaller order.
-
getExecutionTime
final Long getExecutionTime()
-
setExecutionTime
final Unit setExecutionTime(Long executionTime)
-
getExecutionError
final Throwable getExecutionError()
Error which happened during task execution, or
nullif the task was successful.
-
setExecutionError
final Unit setExecutionError(Throwable executionError)
-
getRetryCount
final Integer getRetryCount()
Number of times the task was executed, INCLUDING the initial try. E.g. if the task succeeded on the first try this returns 1.
-
setRetryCount
final Unit setRetryCount(Integer retryCount)
-
setFacebookDDLMap
final SendLaunchTask setFacebookDDLMap(Map<out String, Object> facebookDDLMap)
Stores a reference to the Facebook DDL map. The map will be added to the event when it is sent. The task only holds a reference, so the map can still be updated after this call and the event will see the latest values.
-
shouldRetryConversionOrAttr
final Boolean shouldRetryConversionOrAttr()
-
-
-
-