v1.0.7
Capture – Direct Calls
v1.0.7 uses direct calls only. Your app controls navigation and calls each SDK method. Use loanApplicationId as the capture parameter. Photo capture methods now accept an optional AbleCreditFileUploadListener.
Create Loan Case
AbleCredit.createNewLoanCase(this, payload) { result ->
when (result) {
is AbleCreditResult.Success -> {
val loan = result.data
Log.d("AbleCredit", "Created: ${loan?.data?.application?.id}")
}
is AbleCreditResult.Failure ->
Log.e("AbleCredit", "Error: ${result.ableCreditErrorCode} / ${result.message}")
}
}Record Audio
Provide a listener to receive upload status callbacks. Audio upload status is also available via EventChannel in Flutter.
AbleCredit.recordAudio(
context = this,
loanApplicationId = applicationId,
listener = object : AbleCreditFileUploadListener {
override fun onStatusChanged(
uniqueId: String,
status : AbleCreditFileStatus, // CREATED | IN_PROGRESS | UPLOADING | UPLOADED | FAILED
message : String?
) {
Log.d("AbleCredit", "[ $status ] id=$uniqueId • ${message.orEmpty()}")
}
}
)Photo Capture
val photoListener = object : AbleCreditFileUploadListener {
override fun onStatusChanged(
uniqueId: String,
status : AbleCreditFileStatus, // CREATED | IN_PROGRESS | UPLOADING | UPLOADED | FAILED
message : String?
) {
Log.d("AbleCredit", "[ $status ] id=$uniqueId • ${message.orEmpty()}")
}
}
AbleCredit.captureFamilyPhotos(this, applicationId, photoListener)
AbleCredit.captureBusinessPhotos(this, applicationId, photoListener)
AbleCredit.captureCollateralPhotos(this, applicationId, photoListener)Audio Upload Status Stream (Flutter EventChannel)
final sub = AbleCreditSdkBridge.audioUploadStatusStream.listen((event) {
final uniqueId = event['uniqueId'] as String?;
final status = event['status'] as String?;
final message = event['message'] as String?;
debugPrint('audio update => id=$uniqueId status=$status message=$message');
});
// In dispose():
sub.cancel();