The Machine Learning Consent module captures the user's consent to process their biometric data for machine-learning purposes. It records their response on the server. You choose the consent text variant (US or GDPR style) that matches your compliance needs.
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.
Add Machine Learning Consent
Add the module with addMachineLearningConsent(machineLearningConsent).
flowConfigBuilder.addMachineLearningConsent(machineLearningConsent)
flowConfigBuilder.addMachineLearningConsent(machineLearningConsent);
Example
The example below builds a MachineLearningConsent module with the US consent variant, adds it to the flow, and listens for the result through onMachineLearningConsentCompleted().
val machineLearningConsent = MachineLearningConsent.Builder()
.setConsentType(MachineLearningConsent.ConsentType.US)
.build()
val flowConfig = FlowConfig.Builder()
.addMachineLearningConsent(machineLearningConsent)
.build()
val onboardingListener = object : OnboardingListener() {
override fun onMachineLearningConsentCompleted(result: MachineLearningConsentResult) {
// Consent step completed. Process the result.
}
}
IncodeWelcome.getInstance()
.startOnboarding(activityContext, sessionConfig, flowConfig, onboardingListener)
MachineLearningConsent machineLearningConsent = new MachineLearningConsent.Builder()
.setConsentType(MachineLearningConsent.ConsentType.US)
.build();
FlowConfig flowConfig = new FlowConfig.Builder()
.addMachineLearningConsent(machineLearningConsent)
.build();
IncodeWelcome.OnboardingListener onboardingListener = new IncodeWelcome.OnboardingListener() {
@Override
public void onMachineLearningConsentCompleted(@NonNull MachineLearningConsentResult result) {
// Consent step completed. Process the result.
}
};
IncodeWelcome.getInstance()
.startOnboarding(activityContext, sessionConfig, flowConfig, onboardingListener);
Configuration Options
Configure the module with MachineLearningConsent.Builder. The table below lists the available option.
| Setting | Description |
|---|---|
setConsentType(MachineLearningConsent.ConsentType) |
Selects the consent text variant: ConsentType.US or ConsentType.GDPR. Defaults to ConsentType.US. |
For the complete option set, see MachineLearningConsent.Builder in API Reference.
Result
Machine Learning Consent delivers a MachineLearningConsentResult to the onMachineLearningConsentCompleted(MachineLearningConsentResult) callback on the OnboardingListener. Key fields include:
isSuccess:trueif the machine learning consent was submitted successfully; otherwise,false.- Fields inherited from
BaseResult:resultCode: TheResultCodefor this result.error: WhenresultCodeisERROR, theThrowablethat caused it; otherwise,null.deviceStats: TheDeviceStatssnapshot 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 through OnboardingListener.onError(Throwable). This module does not define a module-specific exception subtype.
For all fields, see MachineLearningConsentResult in API Reference.