Skip to main content
The AppDNA SDK supports server-driven onboarding flows that are configured remotely and rendered natively using Jetpack Compose. Onboarding flows guide users through welcome screens, questions, and value propositions without requiring app updates.

Present an Onboarding Flow

Present an onboarding flow by passing the current Activity and an optional flow ID:
import ai.appdna.sdk.AppDNA

val presented = AppDNA.presentOnboarding(
    activity = this,
    flowId = "main_flow",
    listener = onboardingListener
)

if (!presented) {
    Log.w("Onboarding", "No onboarding flow available")
}
The method returns a Boolean indicating whether the flow was successfully presented. If flowId is null, the SDK uses the active flow from the remote configuration.
// Use the default active flow
val presented = AppDNA.presentOnboarding(
    activity = this,
    flowId = null,
    listener = onboardingListener
)

Onboarding Module

The AppDNA.onboarding module provides direct access to onboarding functionality:
MethodReturnDescription
present(activity, flowId?, context?)BooleanPresents the onboarding flow
setDelegate(delegate: AppDNAOnboardingDelegate?)UnitSets the onboarding delegate

Onboarding Context

Pass additional context when presenting an onboarding flow:
import ai.appdna.sdk.onboarding.OnboardingContext

val context = OnboardingContext(
    source = "deep_link",
    campaign = "summer_promo",
    referrer = "friend_invite",
    userProperties = mapOf("tier" to "free"),
    experimentOverrides = mapOf("welcome_variant" to "b")
)

AppDNA.onboarding.present(
    activity = this,
    flowId = "main_flow",
    context = context
)

OnboardingContext Properties

PropertyTypeDescription
sourceString?Where the user came from
campaignString?Marketing campaign identifier
referrerString?Referral source
userPropertiesMap<String, Any>?Additional user properties for targeting
experimentOverridesMap<String, String>?Override experiment variants for testing

Onboarding Delegate

Implement AppDNAOnboardingDelegate to receive onboarding lifecycle callbacks:
import ai.appdna.sdk.onboarding.AppDNAOnboardingDelegate

class MyOnboardingDelegate : AppDNAOnboardingDelegate {

    override fun onOnboardingStarted(flowId: String) {
        Log.d("Onboarding", "Flow started: $flowId")
    }

    override fun onOnboardingStepChanged(
        flowId: String,
        stepId: String,
        stepIndex: Int,
        totalSteps: Int
    ) {
        Log.d("Onboarding", "Step $stepIndex/$totalSteps: $stepId")
    }

    override fun onOnboardingCompleted(flowId: String, responses: Map<String, Any>) {
        Log.d("Onboarding", "Flow completed: $flowId")
        Log.d("Onboarding", "Responses: $responses")
        // Navigate to main app
    }

    override fun onOnboardingDismissed(flowId: String, atStep: Int) {
        Log.d("Onboarding", "Flow dismissed at step $atStep")
    }
}

// Set the delegate
AppDNA.onboarding.setDelegate(MyOnboardingDelegate())

Step Types

Onboarding flows are composed of steps, each with a specific type:
Step TypeDescription
WELCOMEWelcome or splash screen
QUESTIONUser input step with single or multi-select options
VALUE_PROPValue proposition or feature highlight screen
CUSTOMCustom step rendered from server-defined templates

Selection Modes

Question steps support two selection modes:
ModeDescription
SINGLEUser selects exactly one option
MULTIUser can select multiple options
Onboarding flows are rendered using Jetpack Compose. The SDK handles the full UI lifecycle, including step transitions, animations, and response collection. Your app only needs to handle the delegate callbacks.

Auto-Tracked Events

The onboarding module automatically tracks the following events:
EventTriggered When
onboarding_flow_startedUser begins an onboarding flow
onboarding_step_viewedA step is displayed to the user
onboarding_step_completedUser completes a step
onboarding_step_skippedUser skips a step
onboarding_flow_completedUser reaches the end of the flow
onboarding_flow_dismissedUser dismisses the flow before completing
The responses map passed to onOnboardingCompleted contains all user answers keyed by step ID. Use these responses to personalize the user experience or send them to your backend for analysis.

Next Steps

  • Present Paywalls at the end of onboarding flows
  • Set up Billing to handle purchases triggered from onboarding
  • Learn about Offline Support for onboarding config caching