This page is the complete reference for every public API on the Flutter SDK's IncodeOnboardingSdk class. Each entry documents the method's signature, parameters, return value, and a short example.
For module-specific configuration parameters (those used when adding modules to a flow), see Modules. For the shape of result objects and listener event payloads, see Results. For implementation patterns showing how methods compose into a full flow, see Common Implementation Patterns.
init
Initializes the native Incode SDK. Must be called at least once per app lifecycle before any other operation.
Signature
IncodeOnboardingSdk.init({
bool loggingEnabled = true,
String? apiKey,
String? apiUrl,
String? e2eeUrl,
bool? testMode,
bool? waitForTutorials,
bool? disableJailbreakDetection,
bool? externalAnalyticsEnabled,
bool? externalScreenshotsEnabled,
String? clientExperimentId,
bool? sslPinningEnabled,
bool? forceSSLPinning,
required Function() onSuccess,
required Function(String error) onError,
})
Optional Parameters
loggingEnabled: Iftrue, the SDK logs debug information to the console. Defaults totrue.apiKey: API key provided by Incode.apiUrl: API base URL provided by Incode.e2eeUrl: E2EE base URL provided by Incode.testMode: Set totruewhen running the app on a simulator.waitForTutorials: Iftrue, the SDK waits for the user to complete tutorials before starting the onboarding flow. Defaults tofalse.disableJailbreakDetection: Iftrue, the SDK does not check for jailbroken or rooted devices. Defaults tofalse.externalAnalyticsEnabled: Iftrue, the SDK sends analytics events to the external analytics provider. Defaults tofalse.externalScreenshotsEnabled: Iftrue, the SDK allows screenshots to be taken. Defaults tofalse.clientExperimentId: If set, the SDK sends this value to the server for A/B testing. Defaults tonull.sslPinningEnabled: Iftrue, the SDK enables SSL pinning. Defaults tofalse.forceSSLPinning: Iftrue, the SDK forces SSL pinning even if the server does not support it. Defaults tofalse.
Returns / Callbacks
onSuccess(): Called when the SDK is initialized successfully.onError(String error): Called when initialization fails. TheerrorString can be converted to anIncodeSdkInitErrorenum viaerror.toIncodeSdkInitError(). See Results.
Example
IncodeOnboardingSdk.init(
apiKey: 'YOUR_API_KEY',
apiUrl: 'YOUR_API_URL',
testMode: false,
onError: (String error) {
print('Incode init failed: $error');
},
onSuccess: () {
print('Incode initialized successfully!');
},
);
See Installation.
isInitialized
Checks whether the native Incode SDK has finished initialization. This method never throws; any platform error is handled internally and reported as false, so it is safe to use as a quick readiness check before starting a flow.
Signature
Future<bool> IncodeOnboardingSdk.isInitialized()
Returns / Callbacks
- Returns a
Future<bool>that resolves totruewhen the SDK is ready to be used, andfalseotherwise.
Example
final bool ready = await IncodeOnboardingSdk.isInitialized();
if (ready) {
// Safe to start onboarding
}
startOnboarding
Creates a session and runs a complete, locally-defined onboarding flow end to end.
Signature
IncodeOnboardingSdk.startOnboarding({
required OnboardingSessionConfiguration sessionConfig,
required OnboardingFlowConfiguration flowConfig,
OnboardingRecordSessionConfiguration? recordSessionConfig,
required Function() onSuccess,
required Function(String error) onError,
Function(SelfieScanResult result)? onSelfieScanCompleted,
Function(SelfieScanResult result)? onSelfieScanAttemptCompleted,
Function(FaceMatchResult result)? onFaceMatchCompleted,
Function(GeoLocationResult result)? onGeolocationCompleted,
Function(PhoneNumberResult result)? onAddPhoneNumberCompleted,
Function(VideoSelfieResult result)? onVideoSelfieCompleted,
Function(OnboardingSessionResult result)? onOnboardingSessionCreated,
Function(ApprovalResult result)? onApproveCompleted,
Function(UserScoreResult result)? onUserScoreFetched,
Function(GovernmentValidationResult result)? onGovernmentValidationCompleted,
Function(AntifraudResult result)? onAntifraudCompleted,
Function(DocumentScanResult result)? onDocumentScanCompleted,
Function(SignatureResult result)? onSignatureCollected,
Function(CaptchaResult result)? onCaptchaCompleted,
Function(CurpValidationResult result)? onCurpValidationCompleted,
Function(OCREditResult result)? onOCREditCompleted,
Function(EKYBResult result)? onEKYBCompleted,
Function(EKYCResult result)? onEKYCCompleted,
Function(IdScanResult result)? onIdFrontCompleted,
Function(IdScanResult result)? onIdBackCompleted,
Function(IdScanResult result)? onIdFrontAttemptCompleted,
Function(IdScanResult result)? onIdBackAttemptCompleted,
Function(String ocrData)? onIdProcessed,
Function(AddEmailResult result)? onAddEmailCompleted,
Function(AddFullNameResult result)? onAddFullNameCompleted,
Function(MLConsentResult result)? onMLConsentCompleted,
Function(CustomWatchlistResult result)? onCustomWatchlistCompleted,
Function(AesResult result)? onAesCompleted,
Function(UserConsentResult result)? onUserConsentCompleted,
Function(QRScanResult result)? onQRScanCompleted,
Function(GlobalWatchlistResult result)? onGlobalWatchlistCompleted,
Function(CombinedConsentResult result)? onCombinedConsentCompleted,
Function(NFCScanResult result)? onNFCScanCompleted,
Function(FaceAuthenticationResult result)? onFaceAuthenticationCompleted,
Function()? onSSLPinningFailed,
Function(OnEventsResult result)? onEvents,
Function()? onUserCancelled,
})
Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject that contains the configuration for the onboarding session.flowConfig: AnOnboardingFlowConfigurationobject that contains the configuration for the onboarding flow.
Optional Parameters
recordSessionConfig: AnOnboardingRecordSessionConfigurationobject that contains the configuration for recording the onboarding session.
You can provide any of the following parameters to the OnboardingSessionConfiguration constructor:
region: Defaults toALL.onboardingValidationModules: List ofOnboardingValidationModuleitems. Determines which modules are used for verification and onboarding score calculation. Ifnull, the defaults are used: id, faceRecognition, and liveness.queue: Name of the video conference queue. Defaults tonull, which uses the default queue.customFields: Custom fields sent to the server.externalId: User identifier outside of the Incode Omni database. If a session with the sameexternalIdalready exists, it is resumed; otherwise, a new session is created.externalCustomerId: Identifier linking the onboarding session to an entity in an external system. Typically used to represent a prospect ID or customer ID from your own database.interviewId: Unique identifier of an existing session. Resumes that session.token: Token of an existing session. Resumes that session. See Token-Based Setup.configurationId: Flow URL/ID from Dashboard. On this pattern, the locally configured flow still executes; theconfigurationIddoes not take precedence. To run a Dashboard-configured Flow, see Run Flows Configured Online.e2eEncryptionEnabled: Enables End-to-End Encryption for the session. See End-to-End Encryption (E2EE).voiceConsentLanguage: Language code used for the voice consent reading during the Video Selfie step. Supported values:en,es,pt,he. Other values fall back toen. Codes are mapped to specific locales:en→en-US,es→es-ES,pt→pt-BR,he→he-IL.
Returns / Callbacks
onSuccess(): Called when the onboarding flow completes successfully.onError(String error): Called when an error occurs. TheerrorString can be converted to anIncodeSdkFlowErrorenum viaerror.toIncodeSdkFlowError(). See Results.onUserCancelled(): Called when the user cancels the onboarding flow.- Per-module step callbacks: Add the callbacks for modules whose results you want to receive as they complete. See Results for the full list of available listeners and their payloads.
onSSLPinningFailed(): Called when SSL pinning fails.onEvents(OnEventsResult result): Called when a tracking event occurs during the onboarding flow. See Results.
Example
OnboardingSessionConfiguration sessionConfig = OnboardingSessionConfiguration();
OnboardingFlowConfiguration flowConfig = OnboardingFlowConfiguration();
flowConfig.addIdScan();
flowConfig.addSelfieScan();
flowConfig.addFaceMatch();
OnboardingRecordSessionConfiguration recordSessionConfig = OnboardingRecordSessionConfiguration(
recordSession: true,
forcePermission: false,
);
IncodeOnboardingSdk.startOnboarding(
sessionConfig: sessionConfig,
flowConfig: flowConfig,
recordSessionConfig: recordSessionConfig,
onSuccess: () {
print('Incode Onboarding completed!');
},
onError: (String error) {
print('Incode onboarding error: $error');
},
onSelfieScanCompleted: (SelfieScanResult result) {
print('Selfie completed result: $result');
},
onIdFrontCompleted: (IdScanResult result) {
print('onIdFrontCompleted result: $result');
},
onIdBackCompleted: (IdScanResult result) {
print('onIdBackCompleted result: $result');
},
onIdProcessed: (String ocrData) {
print('onIdProcessed result: $ocrData');
},
);
See Configure Flows Locally and Run End to End.
setupOnboardingSession
Creates an onboarding session without starting any flow. Before calling any other Onboarding SDK component that operates on a session (for example, startNewOnboardingSection), you must set up an onboarding session first.
Signature
Future<void> IncodeOnboardingSdk.setupOnboardingSession({
required OnboardingSessionConfiguration sessionConfig,
required Function(OnboardingSessionResult result) onSuccess,
required Function(String error) onError,
})
Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject. Can be configured in the same way as forstartOnboarding.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(OnboardingSessionResult result): Delivers the created session details.onError(String error): Delivers the error message on failure.
Example
OnboardingSessionConfiguration sessionConfiguration = OnboardingSessionConfiguration();
IncodeOnboardingSdk.setupOnboardingSession(
sessionConfig: sessionConfiguration,
onError: (String error) {
print('Incode onboarding session error: $error');
},
onSuccess: (OnboardingSessionResult result) {
print('Incode Onboarding session created! $result');
},
);
See Configure Flows Locally and Run Step by Step.
startNewOnboardingSection
Once a new onboarding session is created (see setupOnboardingSession), you can separate the Onboarding SDK flow into multiple sections based on your needs. Each section runs the modules defined in its flowConfig and is identified by a flowTag.
Signature
IncodeOnboardingSdk.startNewOnboardingSection({
required OnboardingFlowConfiguration flowConfig,
required String flowTag,
OnboardingRecordSessionConfiguration? recordSessionConfig,
required Function(String error) onError,
Function(String flowTag)? onOnboardingSectionCompleted,
// ...optional per-module step callbacks (see startOnboarding)
})
Required Parameters
flowConfig: AnOnboardingFlowConfigurationobject that defines which modules run in this section.flowTag: A required identifier for the section. Returned viaonOnboardingSectionCompleted.
Optional Parameters
recordSessionConfig: AnOnboardingRecordSessionConfigurationobject that contains the configuration for recording the session.
Returns / Callbacks
onError(String error): Called when an error occurs during the section.onOnboardingSectionCompleted(String flowTag): Called when the section completes. TheflowTagparameter contains the identifier of the completed section.onUserCancelled(): Called when the user cancels the section.- Per-module step callbacks: This method also accepts the same optional per-module step callbacks as
startOnboarding(for example,onSelfieScanCompleted,onIdFrontCompleted,onIdBackCompleted,onIdProcessed,onFaceMatchCompleted,onEvents).
Example
OnboardingFlowConfiguration flowConfig = OnboardingFlowConfiguration();
flowConfig.addIdScan();
IncodeOnboardingSdk.startNewOnboardingSection(
flowConfig: flowConfig,
flowTag: 'idSection',
onError: (String error) {
print('Incode onboarding session error: $error');
},
onIdFrontCompleted: (IdScanResult result) {
print('onIdFrontCompleted result: $result');
},
onIdBackCompleted: (IdScanResult result) {
print('onIdBackCompleted result: $result');
},
onIdProcessed: (String ocrData) {
print('onIdProcessed result: $ocrData');
},
onOnboardingSectionCompleted: (String flowTag) {
print('section completed');
},
);
See Configure Flows Locally and Run Step by Step.
finishFlow
Finishes the current onboarding session for section-based flows. Call finishFlow() at the end of the flow, when you are sure the user has finished all onboarding modules and you won't be reusing the same interviewId again.
finishFlow() is only required for section-based flows (those started with startNewOnboardingSection). Do not call it for flows started with startOnboarding.
Signature
Future<void> IncodeOnboardingSdk.finishFlow({
Function()? onSuccess,
Function(String error)? onError,
})
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(): Called when the flow is finished successfully.onError(String error): Called when finishing the flow fails.
Example
IncodeOnboardingSdk.finishFlow();
startFlow
Starts a server-configured Flow based on the OnboardingSessionConfiguration provided. Specify the configurationId, and optionally the interviewId to resume a session and/or moduleId to start from a specific step within the flow.
Signature
IncodeOnboardingSdk.startFlow({
required OnboardingSessionConfiguration sessionConfig,
String? moduleId,
required Function() onSuccess,
required Function(String error) onError,
Function()? onUserCancelled,
// ...optional per-module step callbacks (see startOnboarding)
})
Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject. Set itsconfigurationIdand optionallyinterviewId.
Optional Parameters
moduleId: Identifier of the step to start from within the flow (for example,"PHONE"). See Modules for the list of valid module IDs.
Returns / Callbacks
onSuccess(): Called when the Flow completes successfully.onError(String error): Called when an error occurs during the Flow.onUserCancelled(): Called when the user cancels the Flow.- Per-module step callbacks: This method also accepts the same optional per-module step callbacks as
startOnboarding.
Example
OnboardingSessionConfiguration sessionConfig = OnboardingSessionConfiguration(
configurationId: "YOUR_CONFIGURATION_ID",
interviewId: "YOUR_INTERVIEW_ID", // optional
);
IncodeOnboardingSdk.startFlow(
sessionConfig: sessionConfig,
moduleId: 'YOUR_MODULE_ID', // optional, e.g., "PHONE"
onError: (String error) {
print('Incode startFlow error: $error');
},
onSuccess: () {
print('Incode startFlow completed!');
},
onUserCancelled: () {
print('User cancelled');
},
);
See Run Flows Configured Online.
startWorkflow
Starts a server-defined Workflow for the provided OnboardingSessionConfiguration. The set of modules that run is determined by the Workflow configured in Dashboard, rather than by a locally-defined flowConfig.
Signature
IncodeOnboardingSdk.startWorkflow({
required OnboardingSessionConfiguration sessionConfig,
required Function() onSuccess,
required Function(String error) onError,
Function()? onUserCancelled,
// ...optional per-module step callbacks (see startOnboarding)
})
Required Parameters
sessionConfig: AnOnboardingSessionConfigurationobject. Set itsconfigurationIdto point at the Workflow configured in Dashboard.
Returns / Callbacks
onSuccess(): Called when the Workflow completes successfully.onError(String error): Called when an error occurs during the Workflow.onUserCancelled(): Called when the user cancels the Workflow.- Per-module step callbacks: This method also accepts the same optional per-module step callbacks as
startOnboarding.
Example
OnboardingSessionConfiguration sessionConfig = OnboardingSessionConfiguration(
configurationId: "YOUR_CONFIGURATION_ID",
);
IncodeOnboardingSdk.startWorkflow(
sessionConfig: sessionConfig,
onError: (String error) {
print('Incode startWorkflow error: $error');
},
onSuccess: () {
print('Incode startWorkflow completed!');
},
onUserCancelled: () {
print('User cancelled');
},
);
See Run Flows Configured Online.
faceMatch
Programmatically initiates a face match between the photo from the ID and the selfie. Matches silently in the background, in contrast to the regular FaceMatch module that shows UI feedback to the user. This API can only be used during an active session.
Signature
Future<void> IncodeOnboardingSdk.faceMatch({
FaceMatchType? faceMatchType,
String? interviewId,
IdCategory? idCategory,
required Function() onSuccess,
required Function(String error) onError,
Function(FaceMatchResult faceMatchResult)? onFaceMatchCompleted,
Function()? onUserCancelled,
})
Optional Parameters
faceMatchType:FaceMatchType.idSelfie,FaceMatchType.nfcSelfie, orFaceMatchType.nfc3Way. Selects which sources are compared.interviewId: Identifier of the session to run the match against.idCategory:IdCategory.primaryorIdCategory.secondary. Selects which scanned ID to use.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(): Called when the face match completes successfully.onError(String error): Called when the operation fails.onFaceMatchCompleted(FaceMatchResult result): Delivers theFaceMatchResultpayload. See Results.onUserCancelled(): Called when the user cancels.
Example
IncodeOnboardingSdk.faceMatch(
onError: (String error) {
print('FaceMatch error: $error');
},
onSuccess: () {
print('FaceMatch completed!');
},
onUserCancelled: () {
print('FaceMatch cancelled by user.');
},
onFaceMatchCompleted: (FaceMatchResult result) {
print('FaceMatch result: $result');
},
);
setTheme
Applies a custom theme to the SDK UI.
Signature
Future<void> IncodeOnboardingSdk.setTheme({
required Map<String, dynamic> theme,
})
Required Parameters
theme: A map describing the theme. JSON-encoded internally before being passed to the native SDK.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setTheme(theme: {
'primaryColor': '#0000FF',
});
See Customization for the full theme schema.
setSdkMode
Sets the SDK operating mode, controlling whether the SDK captures data, submits it, or both.
Signature
Future<void> IncodeOnboardingSdk.setSdkMode({
required SdkMode sdkMode,
})
Required Parameters
sdkMode:SdkMode.captureOnly,SdkMode.submitOnly, orSdkMode.standard.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setSdkMode(sdkMode: SdkMode.standard);
See SDK Modes.
showCloseButton
Displays an 'X' button on the top right of each module so the user can cancel the flow at any point.
Signature
Future<void> IncodeOnboardingSdk.showCloseButton({
required bool allowUserToCancel,
})
Required Parameters
allowUserToCancel: Iftrue, the close button is shown and the user can cancel the flow.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
IncodeOnboardingSdk.showCloseButton(allowUserToCancel: true);
setLocalizationLanguage
Overrides the language used for the SDK UI strings.
Signature
Future<void> IncodeOnboardingSdk.setLocalizationLanguage({
required String language,
})
Required Parameters
language: The language code to use (for example,"en"or"es"). See Customization for the full list of supported codes.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setLocalizationLanguage(language: 'es');
setString
Overrides individual UI strings by key, allowing custom copy without changing the localization language.
Signature
Future<void> IncodeOnboardingSdk.setString({
required Map<String, dynamic> strings,
})
Required Parameters
strings: A map of string keys to their override values.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setString(strings: {
'selfie_scan_title': 'Take a selfie',
});
See Customization for platform-specific string key references.
getUserScore
Fetches the current onboarding session user score at any point.
Signature
Future<void> IncodeOnboardingSdk.getUserScore({
UserScoreFetchMode? fetchMode,
required Function(UserScoreResult result) onSuccess,
required Function(String error) onError,
})
Optional Parameters
fetchMode:UserScoreFetchMode.fastorUserScoreFetchMode.accurate. Controls the trade-off between speed and accuracy.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(UserScoreResult result): Delivers the score.onError(String error): Called when the operation fails.
Example
IncodeOnboardingSdk.getUserScore(
onSuccess: (UserScoreResult result) {
print("userScore: $result");
},
onError: (String error) {
print("userScore error: $error");
},
);
idProcess
Processes IDs programmatically without displaying a user interface (non-UI ID processing).
Signature
Future<void> IncodeOnboardingSdk.idProcess({
IdCategory? idCategory,
required Function(IdProcessResult result) onSuccess,
required Function(String error) onError,
})
Optional Parameters
idCategory:IdCategory.primaryorIdCategory.secondary. Selects which ID to process.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(IdProcessResult result): Called when processing completes. See Results for theIdProcessResultshape.onError(String error): Called when the operation fails.
Example
IncodeOnboardingSdk.idProcess(
idCategory: IdCategory.primary,
onSuccess: (IdProcessResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);
startFaceLogin
Authenticates a returning user by their face. A prerequisite for successful Face Login is that the user has an approved account with an enrolled face. Pass a customerUUID on the FaceLogin object to perform a 1:1 comparison, or omit it to perform a 1:N database lookup.
Signature
Future<void> IncodeOnboardingSdk.startFaceLogin({
required FaceLogin faceLogin,
required Function(FaceLoginResult result) onSuccess,
required Function(String error) onError,
})
Required Parameters
faceLogin: AFaceLoginobject describing how the login should run. For the full set of configuration parameters (authentication modes, face mask check, lenses check, log authentication, E2EE), see Face Login.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(FaceLoginResult result): Called when the login completes. See Results for the fullFaceLoginResultshape.onError(String error): Called when the login fails.
Example
1:1 Face Login:
IncodeOnboardingSdk.startFaceLogin(
faceLogin: FaceLogin(customerUUID: "yourCustomerUUID"),
onSuccess: (FaceLoginResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);
1:N Face Login:
IncodeOnboardingSdk.startFaceLogin(
faceLogin: FaceLogin(),
onSuccess: (FaceLoginResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);
See Face Login.
addNOM151Archive
Generates and fetches a NOM-151 archive for the current session.
Signature
Future<void> IncodeOnboardingSdk.addNOM151Archive({
required Function(AddNom151Result result) onSuccess,
required Function(String error) onError,
})
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(AddNom151Result result): Called when the archive is generated. The result containssignatureandarchiveUrlString fields.onError(String error): Called when the operation fails.
Example
IncodeOnboardingSdk.addNOM151Archive(
onSuccess: (AddNom151Result addNom151Result) {
String? signature = addNom151Result.signature;
String? archiveUrl = addNom151Result.archiveUrl;
},
onError: (String error) {
print('Incode addNOM151Archive error: $error');
},
);
addFace
Adds a single identity to the local database. Used with the SDK -l variant for 1:N FaceAuthMode.local Face Login.
Signature
Future<void> IncodeOnboardingSdk.addFace({
required FaceInfo faceInfo,
required Function(bool result) onSuccess,
required Function(String error) onError,
})
Required Parameters
faceInfo: AFaceInfoobject containing:faceTemplate: String. Biometric representation of a user's face.customerUUID: String. Unique customer identifier in Incode's database.templateId: String. Unique identifier of the biometric face representation in Incode's database.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(bool result): Called when the identity is added.resultistrueon success.onError(String error): Called when the operation fails.
Example
FaceInfo faceInfo = FaceInfo(template, uuid, templateId);
IncodeOnboardingSdk.addFace(
faceInfo: faceInfo,
onSuccess: (bool result) {
print(result);
},
onError: (String error) {
print(error);
},
);
See Face Login.
removeFace
Removes a single identity from the local database.
Signature
Future<void> IncodeOnboardingSdk.removeFace({
required String customerUUID,
required Function(bool result) onSuccess,
required Function(String error) onError,
})
Required Parameters
customerUUID: The unique customer identifier of the identity to remove.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(bool result): Called when the identity is removed.resultistrueon success.onError(String error): Called when the operation fails.
Example
IncodeOnboardingSdk.removeFace(
customerUUID: "your_customer_uuid",
onSuccess: (bool result) {
print(result);
},
onError: (String error) {
print(error);
},
);
See Face Login.
getFaces
Fetches all currently stored identities from the local database.
Signature
Future<void> IncodeOnboardingSdk.getFaces({
required Function(List<FaceInfo> result) onSuccess,
required Function(String error) onError,
})
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(List<FaceInfo> result): Called with the list of stored identities.onError(String error): Called when the operation fails.
Example
IncodeOnboardingSdk.getFaces(
onSuccess: (List<FaceInfo> faceInfos) {
print("faceInfos: $faceInfos");
},
onError: (String error) {
print(error);
},
);
See Face Login.
setFaces
Replaces the local database with the provided list of identities. Wipes all currently stored identities before adding the new ones. Pass an empty list to clear the database.
Signature
Future<void> IncodeOnboardingSdk.setFaces({
required List<FaceInfo> faces,
required Function(bool result) onSuccess,
required Function(String error) onError,
})
Required Parameters
faces: The list ofFaceInfoobjects to store. Pass an empty list (List.empty()) to clear the database.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(bool result): Called when the identities are stored.resultistrueon success.onError(String error): Called when the operation fails.
Example
Replace existing identities with a new set:
final faceInfos = <FaceInfo>[
FaceInfo("your_face_template", "your_customer_uuid", "your_template"),
FaceInfo("your_face_template2", "your_customer_uuid2", "your_template2"),
];
IncodeOnboardingSdk.setFaces(
faces: faceInfos,
onSuccess: (bool result) {
print("result: $result");
},
onError: (String error) {
print(error);
},
);
Clear the local database by passing an empty list:
IncodeOnboardingSdk.setFaces(
faces: List.empty(),
onSuccess: (bool result) {
print("result: $result");
},
onError: (String error) {
print(error);
},
);
See Face Login.
getUserOCRData
Fetches the user OCR data for a specific session.
Signature
Future<void> IncodeOnboardingSdk.getUserOCRData({
String? token,
required Function(GetUserOCRDataResult result) onSuccess,
required Function(String error) onError,
})
Optional Parameters
token: Session token identifying the session to fetch OCR data for.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves. onSuccess(GetUserOCRDataResult result): Called with the OCR data. The result'socrDataString field contains the full OCR data in JSON format.onError(String error): Called when the operation fails.
Example
IncodeOnboardingSdk.getUserOCRData(
token: "{SESSION_TOKEN}",
onSuccess: (GetUserOCRDataResult result) {
print(result);
},
onError: (String error) {
print(error);
},
);
setFaceAuthenticationHint
Provides an identity hint to speed up face authentication by indicating which identity is expected.
Signature
Future<void> IncodeOnboardingSdk.setFaceAuthenticationHint({
required String identityId,
})
Required Parameters
identityId: The identifier of the identity to hint at.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setFaceAuthenticationHint(identityId: 'your_identity_id');
setUXConfig
Applies a custom UX configuration to the SDK.
Signature
Future<void> IncodeOnboardingSdk.setUXConfig({
required Map<String, dynamic> jsonConfig,
})
Required Parameters
jsonConfig: A map describing the UX configuration. JSON-encoded internally before being passed to the native SDK.
Returns / Callbacks
- Returns a
Future<void>that completes once the native call resolves.
Example
await IncodeOnboardingSdk.setUXConfig(jsonConfig: {
'showProgressBar': true,
});
For the supported UX configuration keys, see the Android customization guide or the iOS customization guide.
deleteLocalUserData
Deletes all locally stored user data on the device.
Signature
Future<void> IncodeOnboardingSdk.deleteLocalUserData()
Returns / Callbacks
- Returns a
Future<void>that completes once the data has been deleted.
Example
await IncodeOnboardingSdk.deleteLocalUserData();