3 min read
Launch your Footprint onboarding flow from your Android app. Your playbook defines the data to collect and the checks to run. Install the SDK.
Start an onboarding
- Create an onboarding session. Call POST /onboardings and keep the onboarding session token it returns, such as
obtok_xxx. - Launch the flow. When the user taps a button, for example, call
Onboarding.initializewith your activitycontext, theonboardingSessionToken, and anonCompletecallback.
kotlin1Button(
2 onClick = {
3 Onboarding.initialize(
4 context = context,
5 onboardingSessionToken = "YOUR AUTH TOKEN",
6 onComplete = { result ->
7 println("Onboarding completed. Onboarding ID: ${result.onboardingId}")
8 }
9 )
10 }
11) {
12 Text("Launch Footprint onboarding flow")
13}
Handle the result
When the user completes the flow, onComplete receives an OnboardingCompleteResult with validationToken and onboardingId. Send the onboardingId to your backend and read the result with GET /onboardings/{id}. The ID comes from the device, so check that it matches the id your backend got from POST /onboardings for this user before you act on the result. validationToken is deprecated and will be removed, so use onboardingId when possible.
onComplete received the validation token as a plain string. To upgrade, change onComplete = { validationToken -> ... } to onComplete = { result -> ... } and read result.validationToken.The SDK also reports cancellation and errors. Pass onCancel and onError to initialize:
kotlin1Button(
2 onClick = {
3 Onboarding.initialize(
4 context = context,
5 onboardingSessionToken = "YOUR AUTH TOKEN",
6 onComplete = { result ->
7 println("Onboarding completed. Onboarding ID: ${result.onboardingId}")
8 },
9 onCancel = {
10 println("Onboarding was canceled by the user")
11 },
12 onError = { error ->
13 println("Onboarding error: $error")
14 }
15 )
16 }
17) {
18 Text("Launch Footprint onboarding flow")
19}
Customize the appearance
Pass an appearance object to initialize to change the look of the flow:
kotlin1Button(
2 onClick = {
3 Onboarding.initialize(
4 context = context,
5 onboardingSessionToken = "YOUR AUTH TOKEN",
6 onComplete = { result ->
7 println("Onboarding completed. Onboarding ID: ${result.onboardingId}")
8 },
9 onCancel = {
10 println("Onboarding was canceled by the user")
11 },
12 onError = { error ->
13 println("Onboarding error: $error")
14 },
15 appearance = FootprintAppearance(
16 variables = FootprintAppearanceVariables(
17 borderRadius = "8px",
18 buttonPrimaryBg = "#315E4C",
19 colorSuccess = "#315E4C",
20 colorError = "#E33D19"
21 )
22 )
23 )
24 }
25) {
26 Text("Launch Footprint onboarding flow")
27}
The customization guide lists every variable.
Available props
| Variable | Description |
|---|---|
onboardingSessionToken | The onboarding session token you created. |
context | Your activity context. |
onComplete | Optional. Triggered after the user completes the onboarding flow. You receive an OnboardingCompleteResult with validationToken and onboardingId. Read the result with GET /onboardings/{onboardingId}. |
onError | Optional. Called when there was an unrecoverable error during the onboarding flow. |
onCancel | Optional. Triggered when the user abandons the flow. |
appearance | Optional. A FootprintAppearance object that customizes the look of your integration. |
l10n | Optional. The desired localization, as a FootprintL10n object. See Localization configuration. |
Next steps
- Handle the decision reads the onboarding result on your backend.
- Changelog lists notable releases of the Android SDK.