AdjustAnalyticsService

class AdjustAnalyticsService(adjust: AdjustInstance, config: AdjustConfig, identityParameter: String = DEFAULT_IDENTITY_PARAMETER) : AnalyticsLifecycleService, IdentifiableUserService, ConsentService(source)

Adjust's lifecycle and identity, over an AdjustConfig the consumer builds.

The config arrives ready-made, so configure Adjust at your composition root — data residency, log level, default tracker, attribution callbacks and anything else it offers.

val config = AdjustConfig(application, appToken, AdjustConfig.ENVIRONMENT_PRODUCTION).apply {
setUrlStrategy(listOf("eu.adjust.com"), true, true) // EU data residency
setLogLevel(LogLevel.SUPPRESS)
}
AdjustAnalyticsService(adjust, config)

start calls AdjustInstance.initSdk; do not call it yourself. It does not register activity lifecycle callbacks either — Adjust v5 registers its own at process start.

This adapter opts out for you. start disables Adjust before init, so a fresh install collects nothing until setEnabled is called with true. The order matters: a disable() issued before initSdk is applied synchronously as the SDK's starting state, while one issued after runs on Adjust's own executor and loses the race with the first session, which then reaches Adjust's servers. Adjust persists the enabled flag and start overrides it every launch, so re-apply the stored consent decision after start-up.

Parameters

identityParameter

the Adjust global callback parameter identify writes the user id to and reset removes. It must match a callback parameter configured in your Adjust dashboard. Defaults to Adjust's customary user_id. Properties go to the same bag through GenericAdjustPropertySetterFactory, so no io.github.mkhytarmkhoian.herald.Property may use this name: it would overwrite the identity, and reset would then remove the property.

Constructors

Link copied to clipboard
constructor(adjust: AdjustInstance, config: AdjustConfig, identityParameter: String = DEFAULT_IDENTITY_PARAMETER)

Functions

Link copied to clipboard
open suspend fun flush()
Link copied to clipboard
open suspend override fun identify(identity: Identity)
Link copied to clipboard
open suspend override fun reset()
Link copied to clipboard
open suspend override fun setEnabled(enabled: Boolean)
Link copied to clipboard
open suspend override fun start()