SDK reference · Android SDK / Android Individual Modules

Name

The Name module collects the user's name and sends it to the server.

There is no Dashboard equivalent for this module, so you cannot use integration Pattern 3 to add it. You must use Pattern 1 or 2, adding the module to a FlowConfig in code as shown on this page.

{/* PM: True? No Dashboard equivalent? */}

Add Name

Add the module with addName().

flowConfigBuilder.addName()
flowConfigBuilder.addName();

Example

The example below adds Name as the only step in the flow and listens for the result through onAddNameCompleted().

val flowConfig = FlowConfig.Builder()
    .addName()
    .build()

val onboardingListener = object : OnboardingListener() {
    override fun onAddNameCompleted(nameResult: NameResult) {
        // Name captured. Process the result.
    }
}

IncodeWelcome.getInstance()
    .startOnboarding(activityContext, sessionConfig, flowConfig, onboardingListener)
FlowConfig flowConfig = new FlowConfig.Builder()
    .addName()
    .build();

IncodeWelcome.OnboardingListener onboardingListener = new IncodeWelcome.OnboardingListener() {
    @Override
    public void onAddNameCompleted(@NonNull NameResult nameResult) {
        // Name captured. Process the result.
    }
};

IncodeWelcome.getInstance()
    .startOnboarding(activityContext, sessionConfig, flowConfig, onboardingListener);

Configuration Options

Name has no configurable options. It has no Builder, so you add it with the no-argument addName() method.

Result

Name delivers a NameResult to the onAddNameCompleted(NameResult) callback on the OnboardingListener. Key fields include:

  • name: The name captured from the user; null when unavailable.
  • Fields inherited from BaseResult:
    • resultCode: The ResultCode for this result.
    • error: When resultCode is ERROR, the Throwable that caused it; otherwise, null.
    • deviceStats: The DeviceStats snapshot of the device state when the result was produced.
    • motionStatus: Device motion assessment during capture. One of the following:
      • UNCLEAR: Motion could not be determined; the default.
      • PASS: Device motion was within acceptable limits.
      • FAIL: Excessive device motion was detected.

Errors surface via OnboardingListener.onError(Throwable). This module does not deliver a module-specific exception subtype.

For all fields, see NameResult in API Reference.

Was this page helpful?