The Results module shows a screen summarizing the data captured during onboarding, including OCR fields, captured images, and identity scores. It returns an overall user score. The score includes ID validation, liveness, face recognition, and government validation, plus an overall value and status.
For an overview of this module and how it works, see Show Results.
How you use this module depends on your integration pattern. When the app defines the steps in code, you add the module to an IncdOnboardingFlowConfiguration as shown below; when the flow is defined in Dashboard, you reference it and let the back end drive the steps. See Integration Approaches.
Availability: All variants. Adding Results while the SDK is in Submit-Only Mode has no effect; the step is silently skipped.
Add Results
Add an ID Capture or QR Scan module before Results. Results depends on the data those earlier steps produce.
Add a Selfie module before Results. On iOS this is required. Flow configuration validation throws
ModuleConfigurationError.missingModuleif no Selfie module is present anywhere in the flow.Add the module with
addUserScore():// Default fetch mode (Accurate) flowConfig.addUserScore() // Or choose how results are fetched flowConfig.addUserScore(userScoreFetchMode: .fast)
Example
The example below adds ID Capture and Selfie before Results, then reads the overall score and status from onUserScoreFetched(_:) on the onboarding delegate.
flowConfig.addIdScan(scanStep: .both)
flowConfig.addSelfieScan()
flowConfig.addUserScore()
// IncdOnboardingDelegate
func onUserScoreFetched(_ result: UserScore) {
let score = result.overall?.value // for example, "80.5/100"
let status = result.overall?.status
}
To fetch the score without presenting the results screen, use the headless API IncdOnboardingManager.shared.getUserScore(userScoreFetchMode:interviewId:completion:), which returns the same UserScore.
Configuration Options
Results has no builder. Its only option is the fetch mode passed to addUserScore(userScoreFetchMode:).
| Option | Description |
|---|---|
UserScoreFetchMode.accurate |
Fetches the complete, precise score. This is the default (used when no mode is passed). |
UserScoreFetchMode.fast |
Fetches results sooner, trading completeness for speed. |
Result
Results delivers a UserScore through the onUserScoreFetched(_ result: UserScore) callback on IncdOnboardingDelegate.
func onUserScoreFetched(_ result: UserScore)
UserScore fields:
overall: Result?: The overall score and status;nilwhen unavailable.idValidation: IDValidation?: The ID verification checks.liveness: Liveness?: The liveness checks.faceRecognition: FaceRecognition?: The face recognition checks.governmentValidation: GovernmentValidation?: The government validation checks.extendedUserScoreJsonData: Data?: Additional score data as raw JSON.error: IncdError?: The error, if one occurred.
Result carries value: String? (for example, "80.5/100") and status: Status?. Status is one of:
ok("OK"): Passed.warning("WARN"): Passed with warnings.fail("FAIL"): Failed.unknown("UNKNOWN"): Status could not be determined.manual("MANUAL"): Manual review needed.
The per-category structs expose their own overall: Result? plus category-specific detail:
IDValidation:overall,photoSecurityAndQuality: [IDCheck]?,idSpecific: [IDCheck]?.Liveness:overall,livenessScore: Result?,photoQuality: PhotoQuality?.FaceRecognition:overall,croppedFace: String?(Base64-encoded),croppedIDFace: String?(Base64-encoded),existingUser: Bool?.GovernmentValidation:overall,recognitionConfidence: Result?,validationStatus: IDCheck?,ocrValidation: [IDCheck]?.
Each IDCheck carries key: String?, value: String?, and status: Status?.
Errors surface through UserScore.error as an IncdError; for the complete case list, see Common Types. This module does not deliver a module-specific error type.