v1.0.8
Mode 2 – Orchestrator Flow
A single call to AbleCredit.startLoanFlow() drives the entire loan capture journey. You declare an ordered list of steps and a listener. The SDK sequences screens automatically and delivers lifecycle events to your listener.
Builder constraint rules
CREATE_LOAN_CASE, if included, must be the first step.GENERATE_REPORT, if included, must be the last step.- At least one capture step must be present.
- A listener must always be provided.
Sub-mode A – SDK creates loan & drives full flow
val config = AbleCreditFlowConfig.Builder()
.steps(
AbleCreditFlowStep.CREATE_LOAN_CASE, // must be first
AbleCreditFlowStep.RECORD_AUDIO,
AbleCreditFlowStep.CAPTURE_BUSINESS_PHOTOS,
AbleCreditFlowStep.CAPTURE_FAMILY_PHOTOS,
AbleCreditFlowStep.CAPTURE_COLLATERAL_PHOTOS,
AbleCreditFlowStep.GENERATE_REPORT, // must be last if included
)
.listener(object : AbleCreditFlowListener {
override fun onLoanCreated(applicationId: String, response: AbleCreditLoanResponse) {
// Fires before first capture step – persist loan_reference here
val loanRef = response.data.application.loan_reference
myStore.save(applicationId, loanRef)
}
override fun onStepCompleted(step: AbleCreditFlowStep) { /* optional */ }
override fun onFileStatusChanged(
step : AbleCreditFlowStep,
uniqueId: String,
status : AbleCreditFileStatus,
message : String?
) { }
override fun onFlowCompleted(applicationId: String) { /* all steps done */ }
override fun onFlowFailed(step: AbleCreditFlowStep, error: AbleCreditResult.Failure) { }
})
.withNewLoan(payload)
AbleCredit.startLoanFlow(context, config)Sub-mode C – LOS loan handed into the flow
val config = AbleCreditFlowConfig.Builder()
.steps(
AbleCreditFlowStep.RECORD_AUDIO,
AbleCreditFlowStep.CAPTURE_BUSINESS_PHOTOS,
AbleCreditFlowStep.GENERATE_REPORT,
)
.listener(object : AbleCreditFlowListener {
override fun onFlowCompleted(applicationId: String) { }
override fun onFlowFailed(step: AbleCreditFlowStep, error: AbleCreditResult.Failure) { }
override fun onStepCompleted(step: AbleCreditFlowStep) { }
})
.withExistingLoan(loanApplicationId)
AbleCredit.startLoanFlow(context, config)Available flow steps
| Step | Constraint |
|---|---|
CREATE_LOAN_CASE | Must be first, if included |
RECORD_AUDIO | Capture step |
CAPTURE_BUSINESS_PHOTOS | Capture step |
CAPTURE_FAMILY_PHOTOS | Capture step |
CAPTURE_COLLATERAL_PHOTOS | Capture step |
GENERATE_REPORT | Must be last, if included |
Mode 1 – Direct Calls
The lowest-level integration. Your app calls each SDK capture screen individually and owns all navigation between them. The SDK screens have no built-in "Next" button – they open, the user completes the task, and they close.
Mode 3 – Docked Button
Like Mode 1 but each SDK screen shows a persistent button at the bottom that you define. The button's onClick lambda receives the SDK screen's Context – use it to start your own Activity or chain directly to the next SDK method.