diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 18b58818..27b70020 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,6 +20,7 @@ jobs:
channel: 'stable'
- name: Install Dependencies
run: flutter pub get && cd example && flutter pub get && cd ..
+
- name: Lint Flutter
run: flutter analyze
Android:
diff --git a/android/build.gradle b/android/build.gradle
index 13c0b1e1..22a718d0 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -87,6 +87,7 @@ android {
dependencies {
implementation "com.smileidentity:android-sdk:${smileVersion}"
implementation "androidx.core:core-ktx"
+ implementation "androidx.activity:activity-compose:1.9.3"
implementation "androidx.compose.ui:ui"
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose'
implementation "androidx.compose.material3:material3"
@@ -96,7 +97,7 @@ android {
implementation "com.google.mlkit:object-detection:17.0.2"
testImplementation "org.jetbrains.kotlin:kotlin-test"
- testImplementation "io.mockk:mockk:1.13.13"
+ testImplementation "io.mockk:mockk:1.13.14"
}
}
@@ -105,4 +106,4 @@ ktlint {
filter {
exclude { it.file.path.contains(".g.kt") }
}
-}
+}
\ No newline at end of file
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index cc947c56..72777793 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1 +1,61 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt b/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt
index b8e3b1c7..f675e5e0 100644
--- a/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt
+++ b/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt
@@ -44,6 +44,7 @@ import FlutterUploadImageInfo
import FlutterUploadRequest
import FlutterValidDocument
import FlutterValidDocumentsResponse
+import android.os.Bundle
import com.smileidentity.models.ActionResult
import com.smileidentity.models.Actions
import com.smileidentity.models.Antifraud
@@ -115,35 +116,35 @@ fun convertNonNullMapToNullable(map: Map): Map
fun FlutterJobType.toRequest() =
when (this) {
- FlutterJobType.ENHANCEDKYC -> JobType.EnhancedKyc
- FlutterJobType.DOCUMENTVERIFICATION -> JobType.DocumentVerification
- FlutterJobType.BIOMETRICKYC -> JobType.BiometricKyc
- FlutterJobType.ENHANCEDDOCUMENTVERIFICATION -> JobType.EnhancedDocumentVerification
- FlutterJobType.SMARTSELFIEENROLLMENT -> JobType.SmartSelfieEnrollment
- FlutterJobType.SMARTSELFIEAUTHENTICATION -> JobType.SmartSelfieAuthentication
+ FlutterJobType.ENHANCED_KYC -> JobType.EnhancedKyc
+ FlutterJobType.DOCUMENT_VERIFICATION -> JobType.DocumentVerification
+ FlutterJobType.BIOMETRIC_KYC -> JobType.BiometricKyc
+ FlutterJobType.ENHANCED_DOCUMENT_VERIFICATION -> JobType.EnhancedDocumentVerification
+ FlutterJobType.SMART_SELFIE_ENROLLMENT -> JobType.SmartSelfieEnrollment
+ FlutterJobType.SMART_SELFIE_AUTHENTICATION -> JobType.SmartSelfieAuthentication
}
fun JobType.toResponse() =
when (this) {
- JobType.EnhancedKyc -> FlutterJobType.ENHANCEDKYC
- JobType.DocumentVerification -> FlutterJobType.DOCUMENTVERIFICATION
- JobType.BiometricKyc -> FlutterJobType.BIOMETRICKYC
- JobType.EnhancedDocumentVerification -> FlutterJobType.ENHANCEDDOCUMENTVERIFICATION
- JobType.SmartSelfieEnrollment -> FlutterJobType.SMARTSELFIEENROLLMENT
- JobType.SmartSelfieAuthentication -> FlutterJobType.SMARTSELFIEAUTHENTICATION
+ JobType.EnhancedKyc -> FlutterJobType.ENHANCED_KYC
+ JobType.DocumentVerification -> FlutterJobType.DOCUMENT_VERIFICATION
+ JobType.BiometricKyc -> FlutterJobType.BIOMETRIC_KYC
+ JobType.EnhancedDocumentVerification -> FlutterJobType.ENHANCED_DOCUMENT_VERIFICATION
+ JobType.SmartSelfieEnrollment -> FlutterJobType.SMART_SELFIE_ENROLLMENT
+ JobType.SmartSelfieAuthentication -> FlutterJobType.SMART_SELFIE_AUTHENTICATION
else -> TODO("Not yet implemented")
}
fun FlutterJobTypeV2.toRequest() =
when (this) {
- FlutterJobTypeV2.SMARTSELFIEAUTHENTICATION -> JobTypeV2.SmartSelfieAuthentication
- FlutterJobTypeV2.SMARTSELFIEENROLLMENT -> JobTypeV2.SmartSelfieEnrollment
+ FlutterJobTypeV2.SMART_SELFIE_AUTHENTICATION -> JobTypeV2.SmartSelfieAuthentication
+ FlutterJobTypeV2.SMART_SELFIE_ENROLLMENT -> JobTypeV2.SmartSelfieEnrollment
}
fun JobTypeV2.toResponse() =
when (this) {
- JobTypeV2.SmartSelfieAuthentication -> FlutterJobTypeV2.SMARTSELFIEAUTHENTICATION
- JobTypeV2.SmartSelfieEnrollment -> FlutterJobTypeV2.SMARTSELFIEENROLLMENT
+ JobTypeV2.SmartSelfieAuthentication -> FlutterJobTypeV2.SMART_SELFIE_AUTHENTICATION
+ JobTypeV2.SmartSelfieEnrollment -> FlutterJobTypeV2.SMART_SELFIE_ENROLLMENT
else -> TODO("Not yet implemented")
}
@@ -222,14 +223,14 @@ fun FlutterUploadImageInfo.toRequest() =
fun FlutterImageType.toRequest() =
when (this) {
- FlutterImageType.SELFIEJPGFILE -> ImageType.SelfieJpgFile
- FlutterImageType.IDCARDJPGFILE -> ImageType.IdCardJpgFile
- FlutterImageType.SELFIEJPGBASE64 -> ImageType.SelfieJpgBase64
- FlutterImageType.IDCARDJPGBASE64 -> ImageType.IdCardJpgBase64
- FlutterImageType.LIVENESSJPGFILE -> ImageType.LivenessJpgFile
- FlutterImageType.IDCARDREARJPGFILE -> ImageType.IdCardRearJpgFile
- FlutterImageType.LIVENESSJPGBASE64 -> ImageType.LivenessJpgBase64
- FlutterImageType.IDCARDREARJPGBASE64 -> ImageType.IdCardRearJpgBase64
+ FlutterImageType.SELFIE_JPG_FILE -> ImageType.SelfieJpgFile
+ FlutterImageType.ID_CARD_JPG_FILE -> ImageType.IdCardJpgFile
+ FlutterImageType.SELFIE_JPG_BASE64 -> ImageType.SelfieJpgBase64
+ FlutterImageType.ID_CARD_JPG_BASE64 -> ImageType.IdCardJpgBase64
+ FlutterImageType.LIVENESS_JPG_FILE -> ImageType.LivenessJpgFile
+ FlutterImageType.ID_CARD_REAR_JPG_FILE -> ImageType.IdCardRearJpgFile
+ FlutterImageType.LIVENESS_JPG_BASE64 -> ImageType.LivenessJpgBase64
+ FlutterImageType.ID_CARD_REAR_JPG_BASE64 -> ImageType.IdCardRearJpgBase64
}
fun FlutterIdInfo.toRequest() =
@@ -311,20 +312,21 @@ fun ActionResult.toResponse() =
ActionResult.Completed -> FlutterActionResult.COMPLETED
ActionResult.Approved -> FlutterActionResult.APPROVED
ActionResult.Verified -> FlutterActionResult.VERIFIED
- ActionResult.ProvisionallyApproved -> FlutterActionResult.PROVISIONALLYAPPROVED
+ ActionResult.ProvisionallyApproved -> FlutterActionResult.PROVISIONALLY_APPROVED
ActionResult.Returned -> FlutterActionResult.RETURNED
- ActionResult.NotReturned -> FlutterActionResult.NOTRETURNED
+ ActionResult.NotReturned -> FlutterActionResult.NOT_RETURNED
ActionResult.Failed -> FlutterActionResult.FAILED
ActionResult.Rejected -> FlutterActionResult.REJECTED
- ActionResult.UnderReview -> FlutterActionResult.UNDERREVIEW
- ActionResult.UnableToDetermine -> FlutterActionResult.UNABLETODETERMINE
- ActionResult.NotApplicable -> FlutterActionResult.NOTAPPLICABLE
- ActionResult.NotVerified -> FlutterActionResult.NOTVERIFIED
- ActionResult.NotDone -> FlutterActionResult.NOTDONE
- ActionResult.IssuerUnavailable -> FlutterActionResult.ISSUERUNAVAILABLE
+ ActionResult.UnderReview -> FlutterActionResult.UNDER_REVIEW
+ ActionResult.UnableToDetermine -> FlutterActionResult.UNABLE_TO_DETERMINE
+ ActionResult.NotApplicable -> FlutterActionResult.NOT_APPLICABLE
+ ActionResult.NotVerified -> FlutterActionResult.NOT_VERIFIED
+ ActionResult.NotDone -> FlutterActionResult.NOT_DONE
+ ActionResult.IssuerUnavailable -> FlutterActionResult.ISSUER_UNAVAILABLE
ActionResult.IdAuthorityPhotoNotAvailable ->
- FlutterActionResult.IDAUTHORITYPHOTONOTAVAILABLE
- ActionResult.SentToHumanReview -> FlutterActionResult.SENTTOHUMANREVIEW
+ FlutterActionResult.ID_AUTHORITY_PHOTO_NOT_AVAILABLE
+
+ ActionResult.SentToHumanReview -> FlutterActionResult.SENT_TO_HUMAN_REVIEW
ActionResult.Unknown -> FlutterActionResult.UNKNOWN
}
@@ -623,3 +625,32 @@ fun FlutterConfig.toRequest() =
prodBaseUrl = prodBaseUrl,
sandboxBaseUrl = sandboxBaseUrl,
)
+
+fun SmartSelfieResponse.buildBundle() =
+ Bundle().apply {
+ this.putString("code", code)
+ this.putString("created_at", createdAt)
+ this.putString("job_id", jobId)
+ this.putString("job_type", jobType.name)
+ this.putString("message", message)
+ this.putString("partner_id", partnerId)
+ this.putBundle(
+ "partner_params",
+ Bundle().apply {
+ partnerParams.forEach {
+ putString(it.key, it.value)
+ }
+ },
+ )
+ this.putString("status", status.name)
+ this.putString("updated_at", updatedAt)
+ this.putString("user_id", userId)
+ }
+
+fun List.pathList(): ArrayList =
+ ArrayList().let {
+ this.forEach { item ->
+ it.add(item.absolutePath)
+ }
+ return it
+ }
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDBiometricKYCActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDBiometricKYCActivity.kt
new file mode 100644
index 00000000..e4f13972
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDBiometricKYCActivity.kt
@@ -0,0 +1,94 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.BiometricKYC
+import com.smileidentity.models.IdInfo
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomJobId
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+
+class SmileIDBiometricKYCActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val country = intent.getStringExtra("country") ?: ""
+ val idType = intent.getStringExtra("idType")
+ val idNumber = intent.getStringExtra("idNumber")
+ val firstName = intent.getStringExtra("firstName")
+ val middleName = intent.getStringExtra("middleName")
+ val lastName = intent.getStringExtra("lastName")
+ val dob = intent.getStringExtra("dob")
+ val bankCode = intent.getStringExtra("bankCode")
+ val entered =
+ if (intent.hasExtra("entered")) intent.getBooleanExtra("entered", false) else null
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val jobId = intent.getStringExtra("jobId") ?: randomJobId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.BiometricKYC(
+ idInfo = IdInfo(
+ country = country,
+ idType = idType,
+ idNumber = idNumber,
+ firstName = firstName,
+ middleName = middleName,
+ lastName = lastName,
+ dob = dob,
+ bankCode = bankCode,
+ entered = entered,
+ ),
+ userId = userId,
+ jobId = jobId,
+ allowNewEnroll = allowNewEnroll,
+ allowAgentMode = allowAgentMode,
+ showAttribution = showAttribution,
+ showInstructions = showInstructions,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles.pathList(),
+ )
+ intent.putExtra(
+ "didSubmitBiometricKycJob",
+ it.data.didSubmitBiometricKycJob,
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ const val REQUEST_CODE = 16
+ }
+}
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureActivity.kt
new file mode 100644
index 00000000..ef43223d
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureActivity.kt
@@ -0,0 +1,285 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.graphics.BitmapFactory
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.runtime.toMutableStateList
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.asImageBitmap
+import androidx.compose.ui.graphics.painter.BitmapPainter
+import androidx.compose.ui.res.stringResource
+import androidx.lifecycle.viewmodel.compose.viewModel
+import com.smileidentity.R
+import com.smileidentity.SmileID
+import com.smileidentity.compose.components.ImageCaptureConfirmationDialog
+import com.smileidentity.compose.components.LocalMetadata
+import com.smileidentity.compose.document.DocumentCaptureInstructionsScreen
+import com.smileidentity.compose.document.DocumentCaptureScreen
+import com.smileidentity.compose.document.DocumentCaptureSide
+import com.smileidentity.compose.theme.colorScheme
+import com.smileidentity.compose.theme.typography
+import com.smileidentity.models.v2.Metadata
+import com.smileidentity.util.randomJobId
+import com.smileidentity.viewmodel.document.DocumentCaptureViewModel
+import com.smileidentity.viewmodel.viewModelFactory
+import java.io.File
+import java.net.URLDecoder
+import java.nio.charset.StandardCharsets
+
+class SmileIDDocumentCaptureActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val isDocumentFrontSide = intent.getBooleanExtra("isDocumentFrontSide", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val allowGalleryUpload = intent.getBooleanExtra("allowGalleryUpload", false)
+ val showConfirmationDialog = intent.getBooleanExtra("showConfirmationDialog", true)
+ val idAspectRatio = intent.getDoubleExtra("idAspectRatio", -1.0).let {
+ if (it == -1.0) return@let null
+ return@let it.toFloat()
+ }
+
+ setContent {
+ RenderDocumentCaptureContent(
+ isDocumentFrontSide = isDocumentFrontSide,
+ showInstructions = showInstructions,
+ showAttribution = showAttribution,
+ allowGalleryUpload = allowGalleryUpload,
+ showConfirmationDialog = showConfirmationDialog,
+ idAspectRatio = idAspectRatio,
+ )
+ }
+ }
+
+ @Composable
+ private fun RenderDocumentCaptureContent(
+ isDocumentFrontSide: Boolean,
+ showInstructions: Boolean,
+ showAttribution: Boolean,
+ allowGalleryUpload: Boolean,
+ showConfirmationDialog: Boolean,
+ idAspectRatio: Float?,
+ ) {
+ var acknowledgedInstructions by rememberSaveable { mutableStateOf(false) }
+ var galleryDocumentUri: String? by rememberSaveable { mutableStateOf(null) }
+ var documentImageToConfirm: File? by rememberSaveable { mutableStateOf(null) }
+ val jobId = randomJobId()
+ val metadata = LocalMetadata.current
+ val side =
+ if (isDocumentFrontSide) {
+ DocumentCaptureSide.Front
+ } else {
+ DocumentCaptureSide.Back
+ }
+ val viewModel: DocumentCaptureViewModel =
+ viewModel(
+ factory =
+ viewModelFactory {
+ DocumentCaptureViewModel(
+ jobId = jobId,
+ side = side,
+ knownAspectRatio = idAspectRatio,
+ metadata = metadata,
+ )
+ },
+ )
+
+ CompositionLocalProvider(
+ LocalMetadata provides remember { Metadata.default().items.toMutableStateList() },
+ ) {
+ MaterialTheme(
+ colorScheme = SmileID.colorScheme,
+ typography = SmileID.typography,
+ ) {
+ Surface(
+ modifier = Modifier.fillMaxSize(),
+ ) {
+ when {
+ showInstructions && !acknowledgedInstructions ->
+ RenderDocumentCaptureInstructionsScreen(
+ isDocumentFrontSide = isDocumentFrontSide,
+ showAttribution = showAttribution,
+ allowGalleryUpload = allowGalleryUpload,
+ ) { uri ->
+ acknowledgedInstructions = true
+ galleryDocumentUri =
+ uri?.let {
+ URLDecoder.decode(it, StandardCharsets.UTF_8.toString())
+ }
+ }
+
+ showConfirmationDialog && documentImageToConfirm != null ->
+ RenderDocumentCaptureConfirmationScreen(
+ documentImageToConfirm = documentImageToConfirm!!,
+ isDocumentFrontSide = isDocumentFrontSide,
+ ) {
+ documentImageToConfirm = null
+
+ // in case the user chooses to retake an image after a photo gallery
+ // upload, we redirect the user to the instructions screen
+ if (galleryDocumentUri != null) {
+ galleryDocumentUri = null
+ acknowledgedInstructions = false
+ }
+ }
+
+ else ->
+ RenderDocumentCaptureScreen(
+ isDocumentFrontSide = isDocumentFrontSide,
+ idAspectRatio = idAspectRatio,
+ galleryDocumentUri = galleryDocumentUri,
+ jobId = jobId,
+ viewModel = viewModel,
+ showConfirmation = showConfirmationDialog,
+ ) { file ->
+ documentImageToConfirm = file
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Composable
+ private fun RenderDocumentCaptureInstructionsScreen(
+ isDocumentFrontSide: Boolean,
+ showAttribution: Boolean,
+ allowGalleryUpload: Boolean,
+ onInstructionsAcknowledged: (String?) -> Unit,
+ ) {
+ val hero =
+ if (isDocumentFrontSide) {
+ R.drawable.si_doc_v_front_hero
+ } else {
+ R.drawable.si_doc_v_back_hero
+ }
+ val instructionTitle =
+ if (isDocumentFrontSide) {
+ R.string.si_doc_v_instruction_title
+ } else {
+ R.string.si_doc_v_instruction_back_title
+ }
+ val instructionSubTitle =
+ if (isDocumentFrontSide) {
+ R.string.si_verify_identity_instruction_subtitle
+ } else {
+ R.string.si_doc_v_instruction_back_subtitle
+ }
+ DocumentCaptureInstructionsScreen(
+ modifier = Modifier.fillMaxSize(),
+ heroImage = hero,
+ title = stringResource(instructionTitle),
+ subtitle = stringResource(instructionSubTitle),
+ showAttribution = showAttribution,
+ allowPhotoFromGallery = allowGalleryUpload,
+ showSkipButton = false,
+ onSkip = {},
+ onInstructionsAcknowledgedSelectFromGallery = { uri ->
+ onInstructionsAcknowledged(uri)
+ },
+ onInstructionsAcknowledgedTakePhoto = {
+ onInstructionsAcknowledged(null)
+ },
+ )
+ }
+
+ @Composable
+ private fun RenderDocumentCaptureConfirmationScreen(
+ documentImageToConfirm: File,
+ isDocumentFrontSide: Boolean,
+ onRetake: () -> Unit,
+ ) {
+ ImageCaptureConfirmationDialog(
+ modifier = Modifier.fillMaxSize(),
+ titleText = stringResource(R.string.si_doc_v_confirmation_dialog_title),
+ subtitleText = stringResource(R.string.si_doc_v_confirmation_dialog_subtitle),
+ painter =
+ BitmapPainter(
+ BitmapFactory
+ .decodeFile(documentImageToConfirm.absolutePath)
+ .asImageBitmap(),
+ ),
+ confirmButtonText =
+ stringResource(R.string.si_doc_v_confirmation_dialog_confirm_button),
+ onConfirm = {
+ handleConfirmation(isDocumentFrontSide, documentImageToConfirm)
+ },
+ retakeButtonText = stringResource(R.string.si_doc_v_confirmation_dialog_retake_button),
+ onRetake = onRetake,
+ scaleFactor = 1.0f,
+ )
+ }
+
+ @Composable
+ private fun RenderDocumentCaptureScreen(
+ isDocumentFrontSide: Boolean,
+ idAspectRatio: Float?,
+ galleryDocumentUri: String?,
+ jobId: String,
+ viewModel: DocumentCaptureViewModel,
+ showConfirmation: Boolean,
+ onConfirm: (File?) -> Unit,
+ ) {
+ val captureTitleText =
+ if (isDocumentFrontSide) {
+ R.string.si_doc_v_capture_instructions_front_title
+ } else {
+ R.string.si_doc_v_capture_instructions_back_title
+ }
+ DocumentCaptureScreen(
+ modifier = Modifier.fillMaxSize(),
+ jobId = jobId,
+ side = if (isDocumentFrontSide) DocumentCaptureSide.Front else DocumentCaptureSide.Back,
+ captureTitleText = stringResource(captureTitleText),
+ knownIdAspectRatio = idAspectRatio,
+ onConfirm = { file ->
+ if (!showConfirmation) {
+ handleConfirmation(isDocumentFrontSide, file)
+ } else {
+ onConfirm(file)
+ }
+ },
+ onError = { throwable ->
+ val intent = Intent()
+ intent.putExtra("error", throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ },
+ galleryDocumentUri = galleryDocumentUri,
+ viewModel = viewModel,
+ )
+ }
+
+ private fun handleConfirmation(
+ isDocumentFrontSide: Boolean,
+ file: File,
+ ) {
+ val intent = Intent()
+
+ intent.putExtra(
+ if (isDocumentFrontSide) "documentFrontFile" else "documentBackFile",
+ file.absolutePath,
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ companion object {
+ const val REQUEST_CODE = 20
+ }
+}
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentVerificationActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentVerificationActivity.kt
new file mode 100644
index 00000000..418bc060
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentVerificationActivity.kt
@@ -0,0 +1,95 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.DocumentVerification
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomJobId
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+import java.io.File
+
+class SmileIDDocumentVerificationActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val countryCode = intent.getStringExtra("countryCode") ?: ""
+ val documentType = intent.getStringExtra("documentType")
+ val idAspectRatio = intent.getDoubleExtra("idAspectRatio", -1.0).let {
+ if (it == -1.0) return@let null
+ return@let it.toFloat()
+ }
+ val captureBothSides = intent.getBooleanExtra("captureBothSides", true)
+ val bypassSelfieCaptureWithFile =
+ intent.getStringExtra("bypassSelfieCaptureWithFile")?.let {
+ File(it)
+ }
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val jobId = intent.getStringExtra("jobId") ?: randomJobId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false)
+ val allowGalleryUpload = intent.getBooleanExtra("allowGalleryUpload", false)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.DocumentVerification(
+ countryCode = countryCode,
+ documentType = documentType,
+ idAspectRatio = idAspectRatio,
+ captureBothSides = captureBothSides,
+ bypassSelfieCaptureWithFile = bypassSelfieCaptureWithFile,
+ userId = userId,
+ jobId = jobId,
+ allowNewEnroll = allowNewEnroll,
+ showAttribution = showAttribution,
+ allowAgentMode = allowAgentMode,
+ allowGalleryUpload = allowGalleryUpload,
+ showInstructions = showInstructions,
+ skipApiSubmission = skipApiSubmission,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putExtra("documentFrontFile", it.data.documentFrontFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles?.pathList(),
+ )
+ intent.putExtra("documentBackFile", it.data.documentBackFile?.absolutePath)
+ intent.putExtra(
+ "didSubmitDocumentVerificationJob",
+ it.data.didSubmitDocumentVerificationJob,
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+ }
+
+
+ companion object {
+ const val REQUEST_CODE = 17
+ }
+}
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDEnhancedDocumentVerificationActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDEnhancedDocumentVerificationActivity.kt
new file mode 100644
index 00000000..1bfae544
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDEnhancedDocumentVerificationActivity.kt
@@ -0,0 +1,97 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.EnhancedDocumentVerificationScreen
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomJobId
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+import java.io.File
+
+class SmileIDEnhancedDocumentVerificationActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val countryCode = intent.getStringExtra("countryCode") ?: ""
+ val documentType = intent.getStringExtra("documentType")
+ val idAspectRatio = intent.getDoubleExtra("idAspectRatio", -1.0).let {
+ if (it == -1.0) return@let null
+ return@let it.toFloat()
+ }
+ val captureBothSides = intent.getBooleanExtra("captureBothSides", true)
+ val bypassSelfieCaptureWithFile =
+ intent.getStringExtra("bypassSelfieCaptureWithFile")?.let {
+ File(it)
+ }
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val jobId = intent.getStringExtra("jobId") ?: randomJobId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false)
+ val allowGalleryUpload = intent.getBooleanExtra("allowGalleryUpload", false)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.EnhancedDocumentVerificationScreen(
+ countryCode = countryCode,
+ documentType = documentType,
+ idAspectRatio = idAspectRatio,
+ captureBothSides = captureBothSides,
+ bypassSelfieCaptureWithFile = bypassSelfieCaptureWithFile,
+ userId = userId,
+ jobId = jobId,
+ allowNewEnroll = allowNewEnroll,
+ showAttribution = showAttribution,
+ allowAgentMode = allowAgentMode,
+ allowGalleryUpload = allowGalleryUpload,
+ showInstructions = showInstructions,
+ skipApiSubmission = skipApiSubmission,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putExtra("documentFrontFile", it.data.documentFrontFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles?.pathList(),
+ )
+ intent.putExtra("documentBackFile", it.data.documentBackFile?.absolutePath)
+ intent.putExtra(
+ "didSubmitEnhancedDocVJob",
+ it.data.didSubmitEnhancedDocVJob,
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+
+ }
+ }
+ }
+
+ }
+
+
+ companion object {
+ const val REQUEST_CODE = 18
+ }
+}
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt
index 75e956ee..122b61b6 100644
--- a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt
@@ -52,12 +52,15 @@ class SmileIDPlugin :
SmileIDApi,
ActivityAware {
private var activity: Activity? = null
- private lateinit var appContext: Context
+ private lateinit var context: Context
+ private val productsApi = SmileIDProductsPluginApi()
+
private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO)
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
SmileIDApi.setUp(flutterPluginBinding.binaryMessenger, this)
- appContext = flutterPluginBinding.applicationContext
+ productsApi.onAttachedToEngine(flutterPluginBinding)
+ context = flutterPluginBinding.applicationContext
flutterPluginBinding.platformViewRegistry.registerViewFactory(
SmileIDDocumentVerification.VIEW_TYPE_ID,
@@ -107,6 +110,7 @@ class SmileIDPlugin :
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
SmileIDApi.setUp(binding.binaryMessenger, null)
+ productsApi.onDetachedFromEngine(binding)
}
override fun initializeWithApiKey(
@@ -116,7 +120,7 @@ class SmileIDPlugin :
enableCrashReporting: Boolean,
) {
SmileID.initialize(
- context = appContext,
+ context = context,
apiKey = apiKey,
config = config.toRequest(),
useSandbox = useSandbox,
@@ -130,7 +134,7 @@ class SmileIDPlugin :
enableCrashReporting: Boolean,
) {
SmileID.initialize(
- context = appContext,
+ context = context,
config = config.toRequest(),
useSandbox = useSandbox,
enableCrashReporting = false,
@@ -139,7 +143,7 @@ class SmileIDPlugin :
override fun initialize(useSandbox: Boolean) {
SmileID.initialize(
- context = appContext,
+ context = context,
useSandbox = useSandbox,
)
}
@@ -443,13 +447,16 @@ class SmileIDPlugin :
*/
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
this.activity = binding.activity
+ productsApi.onAttachActivity(this.activity)
+ binding.addActivityResultListener(productsApi)
}
override fun onDetachedFromActivityForConfigChanges() {}
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {}
- override fun onDetachedFromActivity() {}
+ override fun onDetachedFromActivity() {
+ }
}
/**
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDProductsPluginApi.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDProductsPluginApi.kt
new file mode 100644
index 00000000..aec99855
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDProductsPluginApi.kt
@@ -0,0 +1,637 @@
+package com.smileidentity.flutter
+
+import BiometricKYCCaptureResult
+import BiometricKYCCreationParams
+import DocumentCaptureCreationParams
+import DocumentCaptureResult
+import DocumentVerificationCreationParams
+import DocumentVerificationEnhancedCreationParams
+import SelfieCaptureViewCreationParams
+import SmartSelfieCaptureResult
+import SmartSelfieCreationParams
+import SmartSelfieEnhancedCreationParams
+import SmileFlutterError
+import SmileIDProductsApi
+import android.app.Activity
+import android.content.Intent
+import android.os.Bundle
+import com.smileidentity.flutter.enhanced.SmileIDSmartSelfieAuthenticationEnhancedActivity
+import com.smileidentity.flutter.enhanced.SmileIDSmartSelfieEnrollmentEnhancedActivity
+import io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding
+import io.flutter.plugin.common.PluginRegistry.ActivityResultListener
+
+class SmileIDProductsPluginApi :
+ ActivityResultListener,
+ SmileIDProductsApi {
+ private var activity: Activity? = null
+ private var smartSelfieResult: ((Result) -> Unit)? = null
+ private var documentCaptureResult: ((Result) -> Unit)? = null
+ private var biometricKycResult: ((Result) -> Unit)? = null
+
+ fun onAttachActivity(activity: Activity?) {
+ this.activity = activity
+ }
+
+ fun onAttachedToEngine(binding: FlutterPluginBinding) {
+ SmileIDProductsApi.setUp(binding.binaryMessenger, this)
+ }
+
+ fun onDetachedFromEngine(binding: FlutterPluginBinding) {
+ SmileIDProductsApi.setUp(binding.binaryMessenger, null)
+ }
+
+ override fun onActivityResult(
+ requestCode: Int,
+ resultCode: Int,
+ data: Intent?,
+ ): Boolean {
+ when (requestCode) {
+ SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE -> {
+ smartSelfieResult?.let { resultCallback ->
+ handleSelfieResult(
+ resultCode,
+ data,
+ SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ smartSelfieResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE -> {
+ smartSelfieResult?.let { resultCallback ->
+ handleSelfieResult(
+ resultCode,
+ data,
+ SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ smartSelfieResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE -> {
+ smartSelfieResult?.let { resultCallback ->
+ handleSelfieResult(
+ resultCode,
+ data,
+ SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ smartSelfieResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE -> {
+ smartSelfieResult?.let { resultCallback ->
+ handleSelfieResult(
+ resultCode,
+ data,
+ SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ smartSelfieResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDSelfieCaptureActivity.REQUEST_CODE -> {
+ smartSelfieResult?.let { resultCallback ->
+ handleSelfieResult(
+ resultCode,
+ data,
+ SmileIDSelfieCaptureActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ smartSelfieResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDDocumentVerificationActivity.REQUEST_CODE -> {
+ documentCaptureResult?.let { resultCallback ->
+ handleDocumentResult(
+ resultCode,
+ data,
+ SmileIDDocumentVerificationActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ documentCaptureResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE -> {
+ documentCaptureResult?.let { resultCallback ->
+ handleDocumentResult(
+ resultCode,
+ data,
+ SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ documentCaptureResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDDocumentCaptureActivity.REQUEST_CODE -> {
+ documentCaptureResult?.let { resultCallback ->
+ handleDocumentResult(
+ resultCode,
+ data,
+ SmileIDDocumentCaptureActivity.REQUEST_CODE.toString(),
+ resultCallback,
+ )
+
+ documentCaptureResult = null
+ return true
+ }
+
+ return false
+ }
+
+ SmileIDBiometricKYCActivity.REQUEST_CODE -> {
+ biometricKycResult?.let { resultCallback ->
+ val errorCode = SmileIDBiometricKYCActivity.REQUEST_CODE.toString()
+ when (resultCode) {
+ Activity.RESULT_OK -> {
+ val result = BiometricKYCCaptureResult(
+ selfieFile = data?.getStringExtra("selfieFile") ?: "",
+ livenessFiles = data?.getStringArrayListExtra("livenessFiles")
+ ?: emptyList(),
+ didSubmitBiometricKycJob = data?.getBooleanExtra(
+ "didSubmitBiometricKycJob",
+ false,
+ ),
+ )
+
+ resultCallback.invoke(Result.success(result))
+ }
+
+ Activity.RESULT_CANCELED -> {
+ val error = data?.getStringExtra("error") ?: "Unknown error"
+ resultCallback.invoke(
+ Result.failure(
+ SmileFlutterError(
+ errorCode,
+ message = error,
+ ),
+ ),
+ )
+ }
+
+ else -> {
+ resultCallback(
+ Result.failure(
+ SmileFlutterError(
+ errorCode,
+ message = "User cancelled operation",
+ ),
+ ),
+ )
+ }
+ }
+
+ biometricKycResult = null
+ return true
+ }
+
+ return false
+ }
+
+ else -> {
+ return false
+ }
+ }
+ }
+
+ override fun documentVerification(
+ creationParams: DocumentVerificationCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDDocumentVerificationActivity::class.java)
+ intent.putExtra("countryCode", creationParams.countryCode)
+ intent.putExtra("documentType", creationParams.documentType)
+ intent.putExtra("idAspectRatio", creationParams.idAspectRatio)
+ intent.putExtra("captureBothSides", creationParams.captureBothSides)
+ intent.putExtra("bypassSelfieCaptureWithFile", creationParams.bypassSelfieCaptureWithFile)
+ intent.putExtra("userId", creationParams.userId)
+ intent.putExtra("jobId", creationParams.jobId)
+ intent.putExtra("allowNewEnroll", creationParams.allowNewEnroll)
+ intent.putExtra("showAttribution", creationParams.showAttribution)
+ intent.putExtra("allowAgentMode", creationParams.allowAgentMode)
+ intent.putExtra("allowGalleryUpload", creationParams.allowGalleryUpload)
+ intent.putExtra("showInstructions", creationParams.showInstructions)
+ intent.putExtra("skipApiSubmission", creationParams.skipApiSubmission)
+ intent.putExtra(
+ "extraPartnerParams",
+ Bundle().apply {
+ creationParams.extraPartnerParams?.forEach { (key, value) ->
+ putString(key, value)
+ }
+ },
+ )
+
+ if (activity != null) {
+ documentCaptureResult = callback
+ activity!!.startActivityForResult(
+ intent,
+ SmileIDDocumentVerificationActivity.REQUEST_CODE,
+ )
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDDocumentVerificationActivity.REQUEST_CODE.toString(),
+ "Failed to start document verification",
+ ),
+ ),
+ )
+ }
+
+ override fun documentVerificationEnhanced(
+ creationParams: DocumentVerificationEnhancedCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDEnhancedDocumentVerificationActivity::class.java)
+ intent.putExtra("countryCode", creationParams.countryCode)
+ intent.putExtra("documentType", creationParams.documentType)
+ intent.putExtra("idAspectRatio", creationParams.idAspectRatio)
+ intent.putExtra("captureBothSides", creationParams.captureBothSides)
+ intent.putExtra("bypassSelfieCaptureWithFile", creationParams.bypassSelfieCaptureWithFile)
+ intent.putExtra("userId", creationParams.userId)
+ intent.putExtra("jobId", creationParams.jobId)
+ intent.putExtra("allowNewEnroll", creationParams.allowNewEnroll)
+ intent.putExtra("showAttribution", creationParams.showAttribution)
+ intent.putExtra("allowAgentMode", creationParams.allowAgentMode)
+ intent.putExtra("allowGalleryUpload", creationParams.allowGalleryUpload)
+ intent.putExtra("showInstructions", creationParams.showInstructions)
+ intent.putExtra("skipApiSubmission", creationParams.skipApiSubmission)
+ intent.putExtra(
+ "extraPartnerParams",
+ Bundle().apply {
+ creationParams.extraPartnerParams?.forEach { (key, value) ->
+ putString(key, value)
+ }
+ },
+ )
+
+ if (activity != null) {
+ documentCaptureResult = callback
+ activity!!.startActivityForResult(
+ intent,
+ SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE,
+ )
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE.toString(),
+ "Failed to start enhanced document verification",
+ ),
+ ),
+ )
+ }
+
+ override fun smartSelfieEnrollment(
+ creationParams: SmartSelfieCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDSmartSelfieEnrollmentActivity::class.java)
+ intent.putSmartSelfieCreationParams(creationParams)
+
+ if (activity != null) {
+ smartSelfieResult = callback
+ activity!!.startActivityForResult(
+ intent,
+ SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE,
+ )
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE.toString(),
+ "Failed to start smart selfie enrollment",
+ ),
+ ),
+ )
+ }
+
+ override fun smartSelfieAuthentication(
+ creationParams: SmartSelfieCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDSmartSelfieAuthenticationActivity::class.java)
+ intent.putSmartSelfieCreationParams(creationParams)
+
+ if (activity != null) {
+ smartSelfieResult = callback
+ activity!!.startActivityForResult(
+ intent,
+ SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE,
+ )
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE.toString(),
+ "Failed to start smart selfie authentication",
+ ),
+ ),
+ )
+ }
+
+ override fun smartSelfieEnrollmentEnhanced(
+ creationParams: SmartSelfieEnhancedCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDSmartSelfieEnrollmentEnhancedActivity::class.java)
+ intent.putSmartSelfieEnhancedCreationParams(creationParams)
+
+ if (activity != null) {
+ smartSelfieResult = callback
+ activity!!.startActivityForResult(
+ intent,
+ SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE,
+ )
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE.toString(),
+ "Failed to start smart selfie enrollment enhanced",
+ ),
+ ),
+ )
+ }
+
+ override fun smartSelfieAuthenticationEnhanced(
+ creationParams: SmartSelfieEnhancedCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDSmartSelfieAuthenticationEnhancedActivity::class.java)
+ intent.putSmartSelfieEnhancedCreationParams(creationParams)
+
+ if (activity != null) {
+ smartSelfieResult = callback
+ activity?.startActivityForResult(
+ intent,
+ SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE,
+ )
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE.toString(),
+ "Failed to start smart selfie authentication enhanced",
+ ),
+ ),
+ )
+ }
+
+ override fun biometricKYC(
+ creationParams: BiometricKYCCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDBiometricKYCActivity::class.java)
+ intent.putExtra("country", creationParams.country)
+ intent.putExtra("idType", creationParams.idType)
+ intent.putExtra("idNumber", creationParams.idNumber)
+ intent.putExtra("firstName", creationParams.firstName)
+ intent.putExtra("middleName", creationParams.middleName)
+ intent.putExtra("lastName", creationParams.lastName)
+ intent.putExtra("dob", creationParams.dob)
+ intent.putExtra("bankCode", creationParams.bankCode)
+ intent.putExtra("entered", creationParams.entered)
+ intent.putExtra("userId", creationParams.userId)
+ intent.putExtra("jobId", creationParams.jobId)
+ intent.putExtra("allowNewEnroll", creationParams.allowNewEnroll)
+ intent.putExtra("allowAgentMode", creationParams.allowAgentMode)
+ intent.putExtra("showAttribution", creationParams.showAttribution)
+ intent.putExtra("showInstructions", creationParams.showInstructions)
+ intent.putExtra(
+ "extraPartnerParams",
+ Bundle().apply {
+ creationParams.extraPartnerParams?.forEach { (key, value) ->
+ putString(key, value)
+ }
+ },
+ )
+
+ if (activity != null) {
+ biometricKycResult = callback
+ activity!!.startActivityForResult(intent, SmileIDBiometricKYCActivity.REQUEST_CODE)
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDBiometricKYCActivity.REQUEST_CODE.toString(),
+ "Failed to start biometric KYC",
+ ),
+ ),
+ )
+ }
+
+ override fun selfieCapture(
+ creationParams: SelfieCaptureViewCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDSelfieCaptureActivity::class.java)
+ intent.putExtra("showConfirmationDialog", creationParams.showConfirmationDialog)
+ intent.putExtra("showInstructions", creationParams.showInstructions)
+ intent.putExtra("showAttribution", creationParams.showAttribution)
+ intent.putExtra("allowAgentMode", creationParams.allowAgentMode)
+
+ if (activity != null) {
+ smartSelfieResult = callback
+ activity!!.startActivityForResult(intent, SmileIDSelfieCaptureActivity.REQUEST_CODE)
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDSelfieCaptureActivity.REQUEST_CODE.toString(),
+ "Failed to start selfie capture",
+ ),
+ ),
+ )
+ }
+
+
+ override fun documentCapture(
+ creationParams: DocumentCaptureCreationParams,
+ callback: (Result) -> Unit,
+ ) {
+ val intent = Intent(activity, SmileIDDocumentCaptureActivity::class.java)
+ intent.putExtra("isDocumentFrontSide", creationParams.isDocumentFrontSide)
+ intent.putExtra("showInstructions", creationParams.showInstructions)
+ intent.putExtra("showAttribution", creationParams.showAttribution)
+ intent.putExtra("allowGalleryUpload", creationParams.allowGalleryUpload)
+ intent.putExtra("showConfirmationDialog", creationParams.showConfirmationDialog)
+ intent.putExtra("idAspectRatio", creationParams.idAspectRatio)
+
+ if (activity != null) {
+ documentCaptureResult = callback
+ activity!!.startActivityForResult(intent, SmileIDDocumentCaptureActivity.REQUEST_CODE)
+ } else
+ callback(
+ Result.failure(
+ SmileFlutterError(
+ SmileIDDocumentCaptureActivity.REQUEST_CODE.toString(),
+ "Failed to start document capture",
+ ),
+ ),
+ )
+ }
+}
+
+private fun Intent.putSmartSelfieCreationParams(creationParams: SmartSelfieCreationParams) =
+ this.apply {
+ putExtra("userId", creationParams.userId)
+ putExtra("allowNewEnroll", creationParams.allowNewEnroll)
+ putExtra("allowAgentMode", creationParams.allowAgentMode)
+ putExtra("showAttribution", creationParams.showAttribution)
+ putExtra("showInstructions", creationParams.showInstructions)
+ putExtra("skipApiSubmission", creationParams.skipApiSubmission)
+ putExtra(
+ "extraPartnerParams",
+ Bundle().apply {
+ creationParams.extraPartnerParams?.forEach { (key, value) ->
+ putString(key, value)
+ }
+ },
+ )
+ }
+
+private fun Intent.putSmartSelfieEnhancedCreationParams(
+ creationParams: SmartSelfieEnhancedCreationParams,
+) = this.apply {
+ putExtra("userId", creationParams.userId)
+ putExtra("allowNewEnroll", creationParams.allowNewEnroll)
+ putExtra("showAttribution", creationParams.showAttribution)
+ putExtra("showInstructions", creationParams.showInstructions)
+ putExtra(
+ "extraPartnerParams",
+ Bundle().apply {
+ creationParams.extraPartnerParams?.forEach { (key, value) ->
+ putString(key, value)
+ }
+ },
+ )
+}
+
+private fun handleSelfieResult(
+ resultCode: Int,
+ data: Intent?,
+ errorCode: String,
+ resultCallback: (Result) -> Unit,
+) {
+ when (resultCode) {
+ Activity.RESULT_OK -> {
+ val apiResponseBundle = data?.getBundleExtra("apiResponse")
+ val apiResponse =
+ apiResponseBundle?.keySet()?.associateWith {
+ return@associateWith if (apiResponseBundle.getString(it) != null) {
+ apiResponseBundle.getString(it)
+ } else {
+ val newBundle = apiResponseBundle.getBundle(it)
+ newBundle?.keySet()?.associateWith { key ->
+ newBundle.getString(key)
+ }
+ }
+ } as Map? ?: emptyMap()
+
+ val result =
+ SmartSelfieCaptureResult(
+ selfieFile = data?.getStringExtra("selfieFile") ?: "",
+ livenessFiles =
+ data?.getStringArrayListExtra("livenessFiles")
+ ?: emptyList(),
+ apiResponse = apiResponse,
+ )
+ resultCallback.invoke(Result.success(result))
+ }
+
+ Activity.RESULT_CANCELED -> {
+ val error = data?.getStringExtra("error") ?: "Unknown error"
+ resultCallback.invoke(Result.failure(SmileFlutterError(errorCode, message = error)))
+ }
+
+ else -> {
+ resultCallback.invoke(
+ Result.failure(
+ SmileFlutterError(
+ errorCode,
+ message = "User cancelled operation",
+ ),
+ ),
+ )
+ }
+ }
+}
+
+private fun handleDocumentResult(
+ resultCode: Int,
+ data: Intent?,
+ errorCode: String,
+ resultCallback: (Result) -> Unit,
+) {
+
+ when (resultCode) {
+ Activity.RESULT_OK -> {
+ val result = DocumentCaptureResult(
+ selfieFile = data?.getStringExtra("selfieFile") ?: "",
+ livenessFiles = data?.getStringArrayListExtra("livenessFiles") ?: emptyList(),
+ documentFrontFile = data?.getStringExtra("documentFrontFile") ?: "",
+ documentBackFile = data?.getStringExtra("documentBackFile") ?: "",
+ didSubmitDocumentVerificationJob = if (data?.hasExtra("didSubmitDocumentVerificationJob") == true) data?.getBooleanExtra(
+ "didSubmitDocumentVerificationJob",
+ false,
+ ) else null,
+ didSubmitEnhancedDocVJob = if (data?.hasExtra("didSubmitEnhanceDocVJob") == true
+ ) data.getBooleanExtra("didSubmitEnhanceDocVJob", false) else null,
+ )
+
+ resultCallback.invoke(Result.success(result))
+ }
+
+ Activity.RESULT_CANCELED -> {
+ val error = data?.getStringExtra("error") ?: "Unknown error"
+ resultCallback.invoke(Result.failure(SmileFlutterError(errorCode, message = error)))
+ }
+
+ else -> {
+ resultCallback.invoke(
+ Result.failure(
+ SmileFlutterError(
+ errorCode,
+ message = "User cancelled operation",
+ ),
+ ),
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSelfieCaptureActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSelfieCaptureActivity.kt
new file mode 100644
index 00000000..4a676a03
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSelfieCaptureActivity.kt
@@ -0,0 +1,225 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.graphics.BitmapFactory
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.consumeWindowInsets
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.statusBars
+import androidx.compose.foundation.layout.windowInsetsPadding
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.runtime.toMutableStateList
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.asImageBitmap
+import androidx.compose.ui.graphics.painter.BitmapPainter
+import androidx.compose.ui.res.stringResource
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import androidx.lifecycle.viewmodel.compose.viewModel
+import com.smileidentity.R
+import com.smileidentity.SmileID
+import com.smileidentity.SmileIDOptIn
+import com.smileidentity.compose.components.ImageCaptureConfirmationDialog
+import com.smileidentity.compose.components.LocalMetadata
+import com.smileidentity.compose.selfie.SelfieCaptureScreen
+import com.smileidentity.compose.selfie.SmartSelfieInstructionsScreen
+import com.smileidentity.compose.theme.colorScheme
+import com.smileidentity.compose.theme.typography
+import com.smileidentity.models.v2.Metadata
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomJobId
+import com.smileidentity.util.randomUserId
+import com.smileidentity.viewmodel.SelfieUiState
+import com.smileidentity.viewmodel.SelfieViewModel
+import com.smileidentity.viewmodel.viewModelFactory
+
+class SmileIDSelfieCaptureActivity : ComponentActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val showConfirmationDialog = intent.getBooleanExtra("showConfirmationDialog", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val allowAgentMode = intent.getBooleanExtra("allowAgentMode", true)
+
+ setContent {
+ RenderSelfieCaptureViewContent(
+ showConfirmationDialog = showConfirmationDialog,
+ showInstructions = showInstructions,
+ showAttribution = showAttribution,
+ allowAgentMode = allowAgentMode,
+ )
+ }
+ }
+
+ @OptIn(SmileIDOptIn::class)
+ @Composable
+ private fun RenderSelfieCaptureViewContent(
+ showConfirmationDialog: Boolean,
+ showInstructions: Boolean,
+ showAttribution: Boolean,
+ allowAgentMode: Boolean,
+ ) {
+ var acknowledgedInstructions by rememberSaveable { mutableStateOf(false) }
+ val userId = randomUserId()
+ val jobId = randomJobId()
+ val metadata = LocalMetadata.current
+ val viewModel: SelfieViewModel =
+ viewModel(
+ factory =
+ viewModelFactory {
+ SelfieViewModel(
+ isEnroll = false,
+ userId = userId,
+ jobId = jobId,
+ allowNewEnroll = false,
+ skipApiSubmission = true,
+ metadata = metadata,
+ )
+ },
+ )
+ val uiState = viewModel.uiState.collectAsStateWithLifecycle().value
+ CompositionLocalProvider(
+ LocalMetadata provides remember { Metadata.default().items.toMutableStateList() },
+ ) {
+ MaterialTheme(colorScheme = SmileID.colorScheme, typography = SmileID.typography) {
+ Surface(
+ content = {
+ when {
+ showInstructions && !acknowledgedInstructions ->
+ SmartSelfieInstructionsScreen(
+ showAttribution = showAttribution,
+ ) {
+ acknowledgedInstructions = true
+ }
+
+ uiState.processingState != null -> HandleProcessingState(viewModel)
+ uiState.selfieToConfirm != null ->
+ HandleSelfieConfirmation(
+ showConfirmationDialog,
+ uiState,
+ viewModel,
+ )
+
+ else -> RenderSelfieCaptureScreen(
+ userId,
+ jobId,
+ allowAgentMode,
+ viewModel,
+ )
+ }
+ },
+ )
+ }
+ }
+ }
+
+
+ @Composable
+ private fun RenderSelfieCaptureScreen(
+ userId: String,
+ jobId: String,
+ allowAgentMode: Boolean,
+ viewModel: SelfieViewModel,
+ ) {
+ Box(
+ modifier =
+ Modifier
+ .background(color = Color.White)
+ .windowInsetsPadding(WindowInsets.statusBars)
+ .consumeWindowInsets(WindowInsets.statusBars)
+ .fillMaxSize(),
+ ) {
+ SelfieCaptureScreen(
+ userId = userId,
+ jobId = jobId,
+ allowAgentMode = allowAgentMode,
+ allowNewEnroll = false,
+ skipApiSubmission = true,
+ viewModel = viewModel,
+ )
+ }
+ }
+
+ @Composable
+ private fun HandleSelfieConfirmation(
+ showConfirmation: Boolean,
+ uiState: SelfieUiState,
+ viewModel: SelfieViewModel,
+ ) {
+ if (showConfirmation) {
+ ImageCaptureConfirmationDialog(
+ titleText = stringResource(R.string.si_smart_selfie_confirmation_dialog_title),
+ subtitleText =
+ stringResource(
+ R.string.si_smart_selfie_confirmation_dialog_subtitle,
+ ),
+ painter =
+ BitmapPainter(
+ BitmapFactory
+ .decodeFile(uiState.selfieToConfirm!!.absolutePath)
+ .asImageBitmap(),
+ ),
+ confirmButtonText =
+ stringResource(
+ R.string.si_smart_selfie_confirmation_dialog_confirm_button,
+ ),
+ onConfirm = {
+ viewModel.submitJob()
+ },
+ retakeButtonText =
+ stringResource(
+ R.string.si_smart_selfie_confirmation_dialog_retake_button,
+ ),
+ onRetake = viewModel::onSelfieRejected,
+ scaleFactor = 1.25f,
+ )
+ } else {
+ viewModel.submitJob()
+ }
+ }
+
+ @Composable
+ private fun HandleProcessingState(viewModel: SelfieViewModel) {
+ viewModel.onFinished { res ->
+ val intent = Intent()
+ when (res) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", res.data.selfieFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ res.data.livenessFiles.pathList(),
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", res.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+
+
+ companion object {
+ const val REQUEST_CODE = 19
+ }
+}
\ No newline at end of file
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieAuthenticationActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieAuthenticationActivity.kt
new file mode 100644
index 00000000..acfaca8c
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieAuthenticationActivity.kt
@@ -0,0 +1,70 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.SmartSelfieAuthentication
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+
+class SmileIDSmartSelfieAuthenticationActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.SmartSelfieAuthentication(
+ userId = userId,
+ allowNewEnroll = allowNewEnroll,
+ allowAgentMode = allowAgentMode,
+ showAttribution = showAttribution,
+ showInstructions = showInstructions,
+ skipApiSubmission = skipApiSubmission,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles.pathList(),
+ )
+
+ intent.putExtra(
+ "apiResponse",
+ it.data.apiResponse?.buildBundle(),
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ const val REQUEST_CODE = 13
+ }
+}
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieEnrollmentActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieEnrollmentActivity.kt
new file mode 100644
index 00000000..ee30068d
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieEnrollmentActivity.kt
@@ -0,0 +1,70 @@
+package com.smileidentity.flutter
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.SmartSelfieEnrollment
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+
+class SmileIDSmartSelfieEnrollmentActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.SmartSelfieEnrollment(
+ userId = userId,
+ allowNewEnroll = allowNewEnroll,
+ allowAgentMode = allowAgentMode,
+ showAttribution = showAttribution,
+ showInstructions = showInstructions,
+ skipApiSubmission = skipApiSubmission,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles.pathList(),
+ )
+
+ intent.putExtra(
+ "apiResponse",
+ it.data.apiResponse?.buildBundle(),
+ )
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ const val REQUEST_CODE = 12
+ }
+}
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt
index c719c28a..6fb0080e 100644
--- a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt
+++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt
@@ -37,7 +37,8 @@ internal class SmileIDSmartSelfieAuthenticationEnhanced private constructor(
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
val moshi =
- Moshi.Builder()
+ Moshi
+ .Builder()
.add(FileAdapter)
.build()
when (it) {
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhancedActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhancedActivity.kt
new file mode 100644
index 00000000..fc352a23
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhancedActivity.kt
@@ -0,0 +1,64 @@
+package com.smileidentity.flutter.enhanced
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.SmartSelfieAuthenticationEnhanced
+import com.smileidentity.flutter.buildBundle
+import com.smileidentity.flutter.pathList
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+
+class SmileIDSmartSelfieAuthenticationEnhancedActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.SmartSelfieAuthenticationEnhanced(
+ userId = userId,
+ allowNewEnroll = allowNewEnroll,
+ showAttribution = showAttribution,
+ showInstructions = showInstructions,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles.pathList(),
+ )
+ intent.putExtra("apiResponse", it.data.apiResponse?.buildBundle())
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ const val REQUEST_CODE = 15
+ }
+}
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt
index 8ff721c9..7ff81b44 100644
--- a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt
+++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt
@@ -37,7 +37,8 @@ internal class SmileIDSmartSelfieEnrollmentEnhanced private constructor(
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
val moshi =
- Moshi.Builder()
+ Moshi
+ .Builder()
.add(FileAdapter)
.build()
when (it) {
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhancedActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhancedActivity.kt
new file mode 100644
index 00000000..03d4ab71
--- /dev/null
+++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhancedActivity.kt
@@ -0,0 +1,63 @@
+package com.smileidentity.flutter.enhanced
+
+import android.content.Intent
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import com.smileidentity.SmileID
+import com.smileidentity.compose.SmartSelfieEnrollmentEnhanced
+import com.smileidentity.flutter.buildBundle
+import com.smileidentity.flutter.pathList
+import com.smileidentity.results.SmileIDResult
+import com.smileidentity.util.randomUserId
+import kotlinx.collections.immutable.toImmutableMap
+
+class SmileIDSmartSelfieEnrollmentEnhancedActivity : ComponentActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ val userId = intent.getStringExtra("userId") ?: randomUserId()
+ val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false)
+ val showAttribution = intent.getBooleanExtra("showAttribution", true)
+ val showInstructions = intent.getBooleanExtra("showInstructions", true)
+ val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams")
+ val extraPartnerParams =
+ extraPartnerParamsBundle?.keySet()?.associateWith {
+ extraPartnerParamsBundle.getString(it)
+ } as? Map ?: emptyMap()
+
+ setContent {
+ SmileID.SmartSelfieEnrollmentEnhanced(
+ userId = userId,
+ allowNewEnroll = allowNewEnroll,
+ showAttribution = showAttribution,
+ showInstructions = showInstructions,
+ extraPartnerParams = extraPartnerParams.toImmutableMap(),
+ ) {
+ val intent = Intent()
+ when (it) {
+ is SmileIDResult.Success -> {
+ intent.putExtra("selfieFile", it.data.selfieFile.absolutePath)
+ intent.putStringArrayListExtra(
+ "livenessFiles",
+ it.data.livenessFiles.pathList(),
+ )
+ intent.putExtra("apiResponse", it.data.apiResponse?.buildBundle())
+
+ setResult(RESULT_OK, intent)
+ finish()
+ }
+
+ is SmileIDResult.Error -> {
+ intent.putExtra("error", it.throwable.message)
+ setResult(RESULT_CANCELED, intent)
+ finish()
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ const val REQUEST_CODE = 14
+ }
+}
diff --git a/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt b/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt
index 10e57714..b16ae75f 100644
--- a/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt
+++ b/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt
@@ -1,11 +1,14 @@
-// Autogenerated from Pigeon (v16.0.5), do not edit directly.
+// Autogenerated from Pigeon (v22.7.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
+@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
import android.util.Log
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryMessenger
+import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MessageCodec
+import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
@@ -15,14 +18,14 @@ private fun wrapResult(result: Any?): List {
}
private fun wrapError(exception: Throwable): List {
- if (exception is SmileFlutterError) {
- return listOf(
+ return if (exception is SmileFlutterError) {
+ listOf(
exception.code,
exception.message,
exception.details
)
} else {
- return listOf(
+ listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
@@ -43,12 +46,12 @@ class SmileFlutterError (
) : Throwable()
enum class FlutterJobType(val raw: Int) {
- ENHANCEDKYC(0),
- DOCUMENTVERIFICATION(1),
- BIOMETRICKYC(2),
- ENHANCEDDOCUMENTVERIFICATION(3),
- SMARTSELFIEENROLLMENT(4),
- SMARTSELFIEAUTHENTICATION(5);
+ ENHANCED_KYC(0),
+ DOCUMENT_VERIFICATION(1),
+ BIOMETRIC_KYC(2),
+ ENHANCED_DOCUMENT_VERIFICATION(3),
+ SMART_SELFIE_ENROLLMENT(4),
+ SMART_SELFIE_AUTHENTICATION(5);
companion object {
fun ofRaw(raw: Int): FlutterJobType? {
@@ -58,8 +61,8 @@ enum class FlutterJobType(val raw: Int) {
}
enum class FlutterJobTypeV2(val raw: Int) {
- SMARTSELFIEAUTHENTICATION(0),
- SMARTSELFIEENROLLMENT(1);
+ SMART_SELFIE_AUTHENTICATION(0),
+ SMART_SELFIE_ENROLLMENT(1);
companion object {
fun ofRaw(raw: Int): FlutterJobTypeV2? {
@@ -69,14 +72,14 @@ enum class FlutterJobTypeV2(val raw: Int) {
}
enum class FlutterImageType(val raw: Int) {
- SELFIEJPGFILE(0),
- IDCARDJPGFILE(1),
- SELFIEJPGBASE64(2),
- IDCARDJPGBASE64(3),
- LIVENESSJPGFILE(4),
- IDCARDREARJPGFILE(5),
- LIVENESSJPGBASE64(6),
- IDCARDREARJPGBASE64(7);
+ SELFIE_JPG_FILE(0),
+ ID_CARD_JPG_FILE(1),
+ SELFIE_JPG_BASE64(2),
+ ID_CARD_JPG_BASE64(3),
+ LIVENESS_JPG_FILE(4),
+ ID_CARD_REAR_JPG_FILE(5),
+ LIVENESS_JPG_BASE64(6),
+ ID_CARD_REAR_JPG_BASE64(7);
companion object {
fun ofRaw(raw: Int): FlutterImageType? {
@@ -90,19 +93,19 @@ enum class FlutterActionResult(val raw: Int) {
COMPLETED(1),
APPROVED(2),
VERIFIED(3),
- PROVISIONALLYAPPROVED(4),
+ PROVISIONALLY_APPROVED(4),
RETURNED(5),
- NOTRETURNED(6),
+ NOT_RETURNED(6),
FAILED(7),
REJECTED(8),
- UNDERREVIEW(9),
- UNABLETODETERMINE(10),
- NOTAPPLICABLE(11),
- NOTVERIFIED(12),
- NOTDONE(13),
- ISSUERUNAVAILABLE(14),
- IDAUTHORITYPHOTONOTAVAILABLE(15),
- SENTTOHUMANREVIEW(16),
+ UNDER_REVIEW(9),
+ UNABLE_TO_DETERMINE(10),
+ NOT_APPLICABLE(11),
+ NOT_VERIFIED(12),
+ NOT_DONE(13),
+ ISSUER_UNAVAILABLE(14),
+ ID_AUTHORITY_PHOTO_NOT_AVAILABLE(15),
+ SENT_TO_HUMAN_REVIEW(16),
UNKNOWN(17);
companion object {
@@ -135,23 +138,20 @@ data class FlutterPartnerParams (
val jobId: String,
val userId: String,
val extras: Map? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterPartnerParams {
- val jobType: FlutterJobType? = (list[0] as Int?)?.let {
- FlutterJobType.ofRaw(it)
- }
- val jobId = list[1] as String
- val userId = list[2] as String
- val extras = list[3] as Map?
+ fun fromList(pigeonVar_list: List): FlutterPartnerParams {
+ val jobType = pigeonVar_list[0] as FlutterJobType?
+ val jobId = pigeonVar_list[1] as String
+ val userId = pigeonVar_list[2] as String
+ val extras = pigeonVar_list[3] as Map?
return FlutterPartnerParams(jobType, jobId, userId, extras)
}
}
fun toList(): List {
- return listOf(
- jobType?.raw,
+ return listOf(
+ jobType,
jobId,
userId,
extras,
@@ -159,6 +159,390 @@ data class FlutterPartnerParams (
}
}
+/** Generated class from Pigeon that represents data sent in messages. */
+data class SmartSelfieCreationParams (
+ val userId: String? = null,
+ val allowNewEnroll: Boolean,
+ val allowAgentMode: Boolean,
+ val showAttribution: Boolean,
+ val showInstructions: Boolean,
+ val skipApiSubmission: Boolean,
+ val extraPartnerParams: Map? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): SmartSelfieCreationParams {
+ val userId = pigeonVar_list[0] as String?
+ val allowNewEnroll = pigeonVar_list[1] as Boolean
+ val allowAgentMode = pigeonVar_list[2] as Boolean
+ val showAttribution = pigeonVar_list[3] as Boolean
+ val showInstructions = pigeonVar_list[4] as Boolean
+ val skipApiSubmission = pigeonVar_list[5] as Boolean
+ val extraPartnerParams = pigeonVar_list[6] as Map?
+ return SmartSelfieCreationParams(userId, allowNewEnroll, allowAgentMode, showAttribution, showInstructions, skipApiSubmission, extraPartnerParams)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ userId,
+ allowNewEnroll,
+ allowAgentMode,
+ showAttribution,
+ showInstructions,
+ skipApiSubmission,
+ extraPartnerParams,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class SmartSelfieEnhancedCreationParams (
+ val userId: String? = null,
+ val allowNewEnroll: Boolean,
+ val showAttribution: Boolean,
+ val showInstructions: Boolean,
+ val extraPartnerParams: Map? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): SmartSelfieEnhancedCreationParams {
+ val userId = pigeonVar_list[0] as String?
+ val allowNewEnroll = pigeonVar_list[1] as Boolean
+ val showAttribution = pigeonVar_list[2] as Boolean
+ val showInstructions = pigeonVar_list[3] as Boolean
+ val extraPartnerParams = pigeonVar_list[4] as Map?
+ return SmartSelfieEnhancedCreationParams(userId, allowNewEnroll, showAttribution, showInstructions, extraPartnerParams)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ userId,
+ allowNewEnroll,
+ showAttribution,
+ showInstructions,
+ extraPartnerParams,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class SmartSelfieCaptureResult (
+ val selfieFile: String? = null,
+ val livenessFiles: List? = null,
+ val apiResponse: Map? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): SmartSelfieCaptureResult {
+ val selfieFile = pigeonVar_list[0] as String?
+ val livenessFiles = pigeonVar_list[1] as List?
+ val apiResponse = pigeonVar_list[2] as Map?
+ return SmartSelfieCaptureResult(selfieFile, livenessFiles, apiResponse)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ selfieFile,
+ livenessFiles,
+ apiResponse,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class DocumentVerificationCreationParams (
+ val countryCode: String,
+ val documentType: String? = null,
+ val idAspectRatio: Double? = null,
+ val captureBothSides: Boolean,
+ val bypassSelfieCaptureWithFile: String? = null,
+ val userId: String? = null,
+ val jobId: String? = null,
+ val allowNewEnroll: Boolean,
+ val showAttribution: Boolean,
+ val allowGalleryUpload: Boolean,
+ val allowAgentMode: Boolean,
+ val showInstructions: Boolean,
+ val skipApiSubmission: Boolean,
+ val extraPartnerParams: Map? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): DocumentVerificationCreationParams {
+ val countryCode = pigeonVar_list[0] as String
+ val documentType = pigeonVar_list[1] as String?
+ val idAspectRatio = pigeonVar_list[2] as Double?
+ val captureBothSides = pigeonVar_list[3] as Boolean
+ val bypassSelfieCaptureWithFile = pigeonVar_list[4] as String?
+ val userId = pigeonVar_list[5] as String?
+ val jobId = pigeonVar_list[6] as String?
+ val allowNewEnroll = pigeonVar_list[7] as Boolean
+ val showAttribution = pigeonVar_list[8] as Boolean
+ val allowGalleryUpload = pigeonVar_list[9] as Boolean
+ val allowAgentMode = pigeonVar_list[10] as Boolean
+ val showInstructions = pigeonVar_list[11] as Boolean
+ val skipApiSubmission = pigeonVar_list[12] as Boolean
+ val extraPartnerParams = pigeonVar_list[13] as Map?
+ return DocumentVerificationCreationParams(countryCode, documentType, idAspectRatio, captureBothSides, bypassSelfieCaptureWithFile, userId, jobId, allowNewEnroll, showAttribution, allowGalleryUpload, allowAgentMode, showInstructions, skipApiSubmission, extraPartnerParams)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ countryCode,
+ documentType,
+ idAspectRatio,
+ captureBothSides,
+ bypassSelfieCaptureWithFile,
+ userId,
+ jobId,
+ allowNewEnroll,
+ showAttribution,
+ allowGalleryUpload,
+ allowAgentMode,
+ showInstructions,
+ skipApiSubmission,
+ extraPartnerParams,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class DocumentVerificationEnhancedCreationParams (
+ val countryCode: String,
+ val documentType: String? = null,
+ val idAspectRatio: Double? = null,
+ val captureBothSides: Boolean,
+ val bypassSelfieCaptureWithFile: String? = null,
+ val userId: String? = null,
+ val jobId: String? = null,
+ val allowNewEnroll: Boolean,
+ val showAttribution: Boolean,
+ val allowAgentMode: Boolean,
+ val allowGalleryUpload: Boolean,
+ val showInstructions: Boolean,
+ val skipApiSubmission: Boolean,
+ val extraPartnerParams: Map? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): DocumentVerificationEnhancedCreationParams {
+ val countryCode = pigeonVar_list[0] as String
+ val documentType = pigeonVar_list[1] as String?
+ val idAspectRatio = pigeonVar_list[2] as Double?
+ val captureBothSides = pigeonVar_list[3] as Boolean
+ val bypassSelfieCaptureWithFile = pigeonVar_list[4] as String?
+ val userId = pigeonVar_list[5] as String?
+ val jobId = pigeonVar_list[6] as String?
+ val allowNewEnroll = pigeonVar_list[7] as Boolean
+ val showAttribution = pigeonVar_list[8] as Boolean
+ val allowAgentMode = pigeonVar_list[9] as Boolean
+ val allowGalleryUpload = pigeonVar_list[10] as Boolean
+ val showInstructions = pigeonVar_list[11] as Boolean
+ val skipApiSubmission = pigeonVar_list[12] as Boolean
+ val extraPartnerParams = pigeonVar_list[13] as Map?
+ return DocumentVerificationEnhancedCreationParams(countryCode, documentType, idAspectRatio, captureBothSides, bypassSelfieCaptureWithFile, userId, jobId, allowNewEnroll, showAttribution, allowAgentMode, allowGalleryUpload, showInstructions, skipApiSubmission, extraPartnerParams)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ countryCode,
+ documentType,
+ idAspectRatio,
+ captureBothSides,
+ bypassSelfieCaptureWithFile,
+ userId,
+ jobId,
+ allowNewEnroll,
+ showAttribution,
+ allowAgentMode,
+ allowGalleryUpload,
+ showInstructions,
+ skipApiSubmission,
+ extraPartnerParams,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class DocumentCaptureResult (
+ val selfieFile: String? = null,
+ val documentFrontFile: String? = null,
+ val livenessFiles: List? = null,
+ val documentBackFile: String? = null,
+ val didSubmitDocumentVerificationJob: Boolean? = null,
+ val didSubmitEnhancedDocVJob: Boolean? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): DocumentCaptureResult {
+ val selfieFile = pigeonVar_list[0] as String?
+ val documentFrontFile = pigeonVar_list[1] as String?
+ val livenessFiles = pigeonVar_list[2] as List?
+ val documentBackFile = pigeonVar_list[3] as String?
+ val didSubmitDocumentVerificationJob = pigeonVar_list[4] as Boolean?
+ val didSubmitEnhancedDocVJob = pigeonVar_list[5] as Boolean?
+ return DocumentCaptureResult(selfieFile, documentFrontFile, livenessFiles, documentBackFile, didSubmitDocumentVerificationJob, didSubmitEnhancedDocVJob)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ selfieFile,
+ documentFrontFile,
+ livenessFiles,
+ documentBackFile,
+ didSubmitDocumentVerificationJob,
+ didSubmitEnhancedDocVJob,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class BiometricKYCCreationParams (
+ val country: String? = null,
+ val idType: String? = null,
+ val idNumber: String? = null,
+ val firstName: String? = null,
+ val middleName: String? = null,
+ val lastName: String? = null,
+ val dob: String? = null,
+ val bankCode: String? = null,
+ val entered: Boolean? = null,
+ val userId: String? = null,
+ val jobId: String? = null,
+ val allowNewEnroll: Boolean,
+ val allowAgentMode: Boolean,
+ val showAttribution: Boolean,
+ val showInstructions: Boolean,
+ val extraPartnerParams: Map? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): BiometricKYCCreationParams {
+ val country = pigeonVar_list[0] as String?
+ val idType = pigeonVar_list[1] as String?
+ val idNumber = pigeonVar_list[2] as String?
+ val firstName = pigeonVar_list[3] as String?
+ val middleName = pigeonVar_list[4] as String?
+ val lastName = pigeonVar_list[5] as String?
+ val dob = pigeonVar_list[6] as String?
+ val bankCode = pigeonVar_list[7] as String?
+ val entered = pigeonVar_list[8] as Boolean?
+ val userId = pigeonVar_list[9] as String?
+ val jobId = pigeonVar_list[10] as String?
+ val allowNewEnroll = pigeonVar_list[11] as Boolean
+ val allowAgentMode = pigeonVar_list[12] as Boolean
+ val showAttribution = pigeonVar_list[13] as Boolean
+ val showInstructions = pigeonVar_list[14] as Boolean
+ val extraPartnerParams = pigeonVar_list[15] as Map?
+ return BiometricKYCCreationParams(country, idType, idNumber, firstName, middleName, lastName, dob, bankCode, entered, userId, jobId, allowNewEnroll, allowAgentMode, showAttribution, showInstructions, extraPartnerParams)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ country,
+ idType,
+ idNumber,
+ firstName,
+ middleName,
+ lastName,
+ dob,
+ bankCode,
+ entered,
+ userId,
+ jobId,
+ allowNewEnroll,
+ allowAgentMode,
+ showAttribution,
+ showInstructions,
+ extraPartnerParams,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class BiometricKYCCaptureResult (
+ val selfieFile: String? = null,
+ val livenessFiles: List? = null,
+ val didSubmitBiometricKycJob: Boolean? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): BiometricKYCCaptureResult {
+ val selfieFile = pigeonVar_list[0] as String?
+ val livenessFiles = pigeonVar_list[1] as List?
+ val didSubmitBiometricKycJob = pigeonVar_list[2] as Boolean?
+ return BiometricKYCCaptureResult(selfieFile, livenessFiles, didSubmitBiometricKycJob)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ selfieFile,
+ livenessFiles,
+ didSubmitBiometricKycJob,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class SelfieCaptureViewCreationParams (
+ val showConfirmationDialog: Boolean,
+ val showInstructions: Boolean,
+ val showAttribution: Boolean,
+ val allowAgentMode: Boolean
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): SelfieCaptureViewCreationParams {
+ val showConfirmationDialog = pigeonVar_list[0] as Boolean
+ val showInstructions = pigeonVar_list[1] as Boolean
+ val showAttribution = pigeonVar_list[2] as Boolean
+ val allowAgentMode = pigeonVar_list[3] as Boolean
+ return SelfieCaptureViewCreationParams(showConfirmationDialog, showInstructions, showAttribution, allowAgentMode)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ showConfirmationDialog,
+ showInstructions,
+ showAttribution,
+ allowAgentMode,
+ )
+ }
+}
+
+/** Generated class from Pigeon that represents data sent in messages. */
+data class DocumentCaptureCreationParams (
+ val isDocumentFrontSide: Boolean,
+ val showInstructions: Boolean,
+ val showAttribution: Boolean,
+ val allowGalleryUpload: Boolean,
+ val showConfirmationDialog: Boolean,
+ val idAspectRatio: Double? = null
+)
+ {
+ companion object {
+ fun fromList(pigeonVar_list: List): DocumentCaptureCreationParams {
+ val isDocumentFrontSide = pigeonVar_list[0] as Boolean
+ val showInstructions = pigeonVar_list[1] as Boolean
+ val showAttribution = pigeonVar_list[2] as Boolean
+ val allowGalleryUpload = pigeonVar_list[3] as Boolean
+ val showConfirmationDialog = pigeonVar_list[4] as Boolean
+ val idAspectRatio = pigeonVar_list[5] as Double?
+ return DocumentCaptureCreationParams(isDocumentFrontSide, showInstructions, showAttribution, allowGalleryUpload, showConfirmationDialog, idAspectRatio)
+ }
+ }
+ fun toList(): List {
+ return listOf(
+ isDocumentFrontSide,
+ showInstructions,
+ showAttribution,
+ allowGalleryUpload,
+ showConfirmationDialog,
+ idAspectRatio,
+ )
+ }
+}
+
/**
* The Auth Smile request. Auth Smile serves multiple purposes:
*
@@ -187,23 +571,22 @@ data class FlutterAuthenticationRequest (
val updateEnrolledImage: Boolean? = null,
val jobId: String? = null,
val userId: String? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterAuthenticationRequest {
- val jobType = FlutterJobType.ofRaw(list[0] as Int)!!
- val country = list[1] as String?
- val idType = list[2] as String?
- val updateEnrolledImage = list[3] as Boolean?
- val jobId = list[4] as String?
- val userId = list[5] as String?
+ fun fromList(pigeonVar_list: List): FlutterAuthenticationRequest {
+ val jobType = pigeonVar_list[0] as FlutterJobType
+ val country = pigeonVar_list[1] as String?
+ val idType = pigeonVar_list[2] as String?
+ val updateEnrolledImage = pigeonVar_list[3] as Boolean?
+ val jobId = pigeonVar_list[4] as String?
+ val userId = pigeonVar_list[5] as String?
return FlutterAuthenticationRequest(jobType, country, idType, updateEnrolledImage, jobId, userId)
}
}
fun toList(): List {
- return listOf(
- jobType.raw,
+ return listOf(
+ jobType,
country,
idType,
updateEnrolledImage,
@@ -230,30 +613,27 @@ data class FlutterAuthenticationResponse (
val partnerParams: FlutterPartnerParams,
val callbackUrl: String? = null,
val consentInfo: FlutterConsentInfo? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterAuthenticationResponse {
- val success = list[0] as Boolean
- val signature = list[1] as String
- val timestamp = list[2] as String
- val partnerParams = FlutterPartnerParams.fromList(list[3] as List)
- val callbackUrl = list[4] as String?
- val consentInfo: FlutterConsentInfo? = (list[5] as List?)?.let {
- FlutterConsentInfo.fromList(it)
- }
+ fun fromList(pigeonVar_list: List): FlutterAuthenticationResponse {
+ val success = pigeonVar_list[0] as Boolean
+ val signature = pigeonVar_list[1] as String
+ val timestamp = pigeonVar_list[2] as String
+ val partnerParams = pigeonVar_list[3] as FlutterPartnerParams
+ val callbackUrl = pigeonVar_list[4] as String?
+ val consentInfo = pigeonVar_list[5] as FlutterConsentInfo?
return FlutterAuthenticationResponse(success, signature, timestamp, partnerParams, callbackUrl, consentInfo)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
success,
signature,
timestamp,
- partnerParams.toList(),
+ partnerParams,
callbackUrl,
- consentInfo?.toList(),
+ consentInfo,
)
}
}
@@ -266,23 +646,22 @@ data class FlutterPrepUploadRequest (
val partnerId: String,
val timestamp: String,
val signature: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterPrepUploadRequest {
- val partnerParams = FlutterPartnerParams.fromList(list[0] as List)
- val callbackUrl = list[1] as String?
- val allowNewEnroll = list[2] as Boolean
- val partnerId = list[3] as String
- val timestamp = list[4] as String
- val signature = list[5] as String
+ fun fromList(pigeonVar_list: List): FlutterPrepUploadRequest {
+ val partnerParams = pigeonVar_list[0] as FlutterPartnerParams
+ val callbackUrl = pigeonVar_list[1] as String?
+ val allowNewEnroll = pigeonVar_list[2] as Boolean
+ val partnerId = pigeonVar_list[3] as String
+ val timestamp = pigeonVar_list[4] as String
+ val signature = pigeonVar_list[5] as String
return FlutterPrepUploadRequest(partnerParams, callbackUrl, allowNewEnroll, partnerId, timestamp, signature)
}
}
fun toList(): List {
- return listOf(
- partnerParams.toList(),
+ return listOf(
+ partnerParams,
callbackUrl,
allowNewEnroll,
partnerId,
@@ -298,20 +677,19 @@ data class FlutterPrepUploadResponse (
val refId: String,
val uploadUrl: String,
val smileJobId: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterPrepUploadResponse {
- val code = list[0] as String
- val refId = list[1] as String
- val uploadUrl = list[2] as String
- val smileJobId = list[3] as String
+ fun fromList(pigeonVar_list: List): FlutterPrepUploadResponse {
+ val code = pigeonVar_list[0] as String
+ val refId = pigeonVar_list[1] as String
+ val uploadUrl = pigeonVar_list[2] as String
+ val smileJobId = pigeonVar_list[3] as String
return FlutterPrepUploadResponse(code, refId, uploadUrl, smileJobId)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
code,
refId,
uploadUrl,
@@ -324,22 +702,19 @@ data class FlutterPrepUploadResponse (
data class FlutterUploadRequest (
val images: List,
val idInfo: FlutterIdInfo? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterUploadRequest {
- val images = list[0] as List
- val idInfo: FlutterIdInfo? = (list[1] as List?)?.let {
- FlutterIdInfo.fromList(it)
- }
+ fun fromList(pigeonVar_list: List): FlutterUploadRequest {
+ val images = pigeonVar_list[0] as List
+ val idInfo = pigeonVar_list[1] as FlutterIdInfo?
return FlutterUploadRequest(images, idInfo)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
images,
- idInfo?.toList(),
+ idInfo,
)
}
}
@@ -348,19 +723,18 @@ data class FlutterUploadRequest (
data class FlutterUploadImageInfo (
val imageTypeId: FlutterImageType,
val imageName: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterUploadImageInfo {
- val imageTypeId = FlutterImageType.ofRaw(list[0] as Int)!!
- val imageName = list[1] as String
+ fun fromList(pigeonVar_list: List): FlutterUploadImageInfo {
+ val imageTypeId = pigeonVar_list[0] as FlutterImageType
+ val imageName = pigeonVar_list[1] as String
return FlutterUploadImageInfo(imageTypeId, imageName)
}
}
fun toList(): List {
- return listOf(
- imageTypeId.raw,
+ return listOf(
+ imageTypeId,
imageName,
)
}
@@ -377,25 +751,24 @@ data class FlutterIdInfo (
val dob: String? = null,
val bankCode: String? = null,
val entered: Boolean? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterIdInfo {
- val country = list[0] as String
- val idType = list[1] as String?
- val idNumber = list[2] as String?
- val firstName = list[3] as String?
- val middleName = list[4] as String?
- val lastName = list[5] as String?
- val dob = list[6] as String?
- val bankCode = list[7] as String?
- val entered = list[8] as Boolean?
+ fun fromList(pigeonVar_list: List): FlutterIdInfo {
+ val country = pigeonVar_list[0] as String
+ val idType = pigeonVar_list[1] as String?
+ val idNumber = pigeonVar_list[2] as String?
+ val firstName = pigeonVar_list[3] as String?
+ val middleName = pigeonVar_list[4] as String?
+ val lastName = pigeonVar_list[5] as String?
+ val dob = pigeonVar_list[6] as String?
+ val bankCode = pigeonVar_list[7] as String?
+ val entered = pigeonVar_list[8] as Boolean?
return FlutterIdInfo(country, idType, idNumber, firstName, middleName, lastName, dob, bankCode, entered)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
country,
idType,
idNumber,
@@ -423,33 +796,32 @@ data class FlutterEnhancedKycResponse (
val expirationDate: String? = null,
val dob: String? = null,
val base64Photo: String? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterEnhancedKycResponse {
- val smileJobId = list[0] as String
- val partnerParams = FlutterPartnerParams.fromList(list[1] as List)
- val resultText = list[2] as String
- val resultCode = list[3] as String
- val actions = FlutterActions.fromList(list[4] as List)
- val country = list[5] as String
- val idType = list[6] as String
- val idNumber = list[7] as String
- val fullName = list[8] as String?
- val expirationDate = list[9] as String?
- val dob = list[10] as String?
- val base64Photo = list[11] as String?
+ fun fromList(pigeonVar_list: List): FlutterEnhancedKycResponse {
+ val smileJobId = pigeonVar_list[0] as String
+ val partnerParams = pigeonVar_list[1] as FlutterPartnerParams
+ val resultText = pigeonVar_list[2] as String
+ val resultCode = pigeonVar_list[3] as String
+ val actions = pigeonVar_list[4] as FlutterActions
+ val country = pigeonVar_list[5] as String
+ val idType = pigeonVar_list[6] as String
+ val idNumber = pigeonVar_list[7] as String
+ val fullName = pigeonVar_list[8] as String?
+ val expirationDate = pigeonVar_list[9] as String?
+ val dob = pigeonVar_list[10] as String?
+ val base64Photo = pigeonVar_list[11] as String?
return FlutterEnhancedKycResponse(smileJobId, partnerParams, resultText, resultCode, actions, country, idType, idNumber, fullName, expirationDate, dob, base64Photo)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
smileJobId,
- partnerParams.toList(),
+ partnerParams,
resultText,
resultCode,
- actions.toList(),
+ actions,
country,
idType,
idNumber,
@@ -480,50 +852,49 @@ data class FlutterActions (
val updateRegisteredSelfieOnFile: FlutterActionResult,
val verifyDocument: FlutterActionResult,
val verifyIdNumber: FlutterActionResult
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterActions {
- val documentCheck = FlutterActionResult.ofRaw(list[0] as Int)!!
- val humanReviewCompare = FlutterActionResult.ofRaw(list[1] as Int)!!
- val humanReviewDocumentCheck = FlutterActionResult.ofRaw(list[2] as Int)!!
- val humanReviewLivenessCheck = FlutterActionResult.ofRaw(list[3] as Int)!!
- val humanReviewSelfieCheck = FlutterActionResult.ofRaw(list[4] as Int)!!
- val humanReviewUpdateSelfie = FlutterActionResult.ofRaw(list[5] as Int)!!
- val livenessCheck = FlutterActionResult.ofRaw(list[6] as Int)!!
- val registerSelfie = FlutterActionResult.ofRaw(list[7] as Int)!!
- val returnPersonalInfo = FlutterActionResult.ofRaw(list[8] as Int)!!
- val selfieCheck = FlutterActionResult.ofRaw(list[9] as Int)!!
- val selfieProvided = FlutterActionResult.ofRaw(list[10] as Int)!!
- val selfieToIdAuthorityCompare = FlutterActionResult.ofRaw(list[11] as Int)!!
- val selfieToIdCardCompare = FlutterActionResult.ofRaw(list[12] as Int)!!
- val selfieToRegisteredSelfieCompare = FlutterActionResult.ofRaw(list[13] as Int)!!
- val updateRegisteredSelfieOnFile = FlutterActionResult.ofRaw(list[14] as Int)!!
- val verifyDocument = FlutterActionResult.ofRaw(list[15] as Int)!!
- val verifyIdNumber = FlutterActionResult.ofRaw(list[16] as Int)!!
+ fun fromList(pigeonVar_list: List): FlutterActions {
+ val documentCheck = pigeonVar_list[0] as FlutterActionResult
+ val humanReviewCompare = pigeonVar_list[1] as FlutterActionResult
+ val humanReviewDocumentCheck = pigeonVar_list[2] as FlutterActionResult
+ val humanReviewLivenessCheck = pigeonVar_list[3] as FlutterActionResult
+ val humanReviewSelfieCheck = pigeonVar_list[4] as FlutterActionResult
+ val humanReviewUpdateSelfie = pigeonVar_list[5] as FlutterActionResult
+ val livenessCheck = pigeonVar_list[6] as FlutterActionResult
+ val registerSelfie = pigeonVar_list[7] as FlutterActionResult
+ val returnPersonalInfo = pigeonVar_list[8] as FlutterActionResult
+ val selfieCheck = pigeonVar_list[9] as FlutterActionResult
+ val selfieProvided = pigeonVar_list[10] as FlutterActionResult
+ val selfieToIdAuthorityCompare = pigeonVar_list[11] as FlutterActionResult
+ val selfieToIdCardCompare = pigeonVar_list[12] as FlutterActionResult
+ val selfieToRegisteredSelfieCompare = pigeonVar_list[13] as FlutterActionResult
+ val updateRegisteredSelfieOnFile = pigeonVar_list[14] as FlutterActionResult
+ val verifyDocument = pigeonVar_list[15] as FlutterActionResult
+ val verifyIdNumber = pigeonVar_list[16] as FlutterActionResult
return FlutterActions(documentCheck, humanReviewCompare, humanReviewDocumentCheck, humanReviewLivenessCheck, humanReviewSelfieCheck, humanReviewUpdateSelfie, livenessCheck, registerSelfie, returnPersonalInfo, selfieCheck, selfieProvided, selfieToIdAuthorityCompare, selfieToIdCardCompare, selfieToRegisteredSelfieCompare, updateRegisteredSelfieOnFile, verifyDocument, verifyIdNumber)
}
}
fun toList(): List {
- return listOf(
- documentCheck.raw,
- humanReviewCompare.raw,
- humanReviewDocumentCheck.raw,
- humanReviewLivenessCheck.raw,
- humanReviewSelfieCheck.raw,
- humanReviewUpdateSelfie.raw,
- livenessCheck.raw,
- registerSelfie.raw,
- returnPersonalInfo.raw,
- selfieCheck.raw,
- selfieProvided.raw,
- selfieToIdAuthorityCompare.raw,
- selfieToIdCardCompare.raw,
- selfieToRegisteredSelfieCompare.raw,
- updateRegisteredSelfieOnFile.raw,
- verifyDocument.raw,
- verifyIdNumber.raw,
+ return listOf(
+ documentCheck,
+ humanReviewCompare,
+ humanReviewDocumentCheck,
+ humanReviewLivenessCheck,
+ humanReviewSelfieCheck,
+ humanReviewUpdateSelfie,
+ livenessCheck,
+ registerSelfie,
+ returnPersonalInfo,
+ selfieCheck,
+ selfieProvided,
+ selfieToIdAuthorityCompare,
+ selfieToIdCardCompare,
+ selfieToRegisteredSelfieCompare,
+ updateRegisteredSelfieOnFile,
+ verifyDocument,
+ verifyIdNumber,
)
}
}
@@ -537,18 +908,17 @@ data class FlutterActions (
data class FlutterConsentInfo (
val canAccess: Boolean,
val consentRequired: Boolean
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterConsentInfo {
- val canAccess = list[0] as Boolean
- val consentRequired = list[1] as Boolean
+ fun fromList(pigeonVar_list: List): FlutterConsentInfo {
+ val canAccess = pigeonVar_list[0] as Boolean
+ val consentRequired = pigeonVar_list[1] as Boolean
return FlutterConsentInfo(canAccess, consentRequired)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
canAccess,
consentRequired,
)
@@ -575,29 +945,28 @@ data class FlutterEnhancedKycRequest (
val partnerParams: FlutterPartnerParams,
val timestamp: String,
val signature: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterEnhancedKycRequest {
- val country = list[0] as String
- val idType = list[1] as String
- val idNumber = list[2] as String
- val firstName = list[3] as String?
- val middleName = list[4] as String?
- val lastName = list[5] as String?
- val dob = list[6] as String?
- val phoneNumber = list[7] as String?
- val bankCode = list[8] as String?
- val callbackUrl = list[9] as String?
- val partnerParams = FlutterPartnerParams.fromList(list[10] as List)
- val timestamp = list[11] as String
- val signature = list[12] as String
+ fun fromList(pigeonVar_list: List): FlutterEnhancedKycRequest {
+ val country = pigeonVar_list[0] as String
+ val idType = pigeonVar_list[1] as String
+ val idNumber = pigeonVar_list[2] as String
+ val firstName = pigeonVar_list[3] as String?
+ val middleName = pigeonVar_list[4] as String?
+ val lastName = pigeonVar_list[5] as String?
+ val dob = pigeonVar_list[6] as String?
+ val phoneNumber = pigeonVar_list[7] as String?
+ val bankCode = pigeonVar_list[8] as String?
+ val callbackUrl = pigeonVar_list[9] as String?
+ val partnerParams = pigeonVar_list[10] as FlutterPartnerParams
+ val timestamp = pigeonVar_list[11] as String
+ val signature = pigeonVar_list[12] as String
return FlutterEnhancedKycRequest(country, idType, idNumber, firstName, middleName, lastName, dob, phoneNumber, bankCode, callbackUrl, partnerParams, timestamp, signature)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
country,
idType,
idNumber,
@@ -608,7 +977,7 @@ data class FlutterEnhancedKycRequest (
phoneNumber,
bankCode,
callbackUrl,
- partnerParams.toList(),
+ partnerParams,
timestamp,
signature,
)
@@ -618,17 +987,16 @@ data class FlutterEnhancedKycRequest (
/** Generated class from Pigeon that represents data sent in messages. */
data class FlutterEnhancedKycAsyncResponse (
val success: Boolean
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterEnhancedKycAsyncResponse {
- val success = list[0] as Boolean
+ fun fromList(pigeonVar_list: List): FlutterEnhancedKycAsyncResponse {
+ val success = pigeonVar_list[0] as Boolean
return FlutterEnhancedKycAsyncResponse(success)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
success,
)
}
@@ -638,18 +1006,17 @@ data class FlutterEnhancedKycAsyncResponse (
data class FlutterImageLinks (
val selfieImageUrl: String? = null,
val error: String? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterImageLinks {
- val selfieImageUrl = list[0] as String?
- val error = list[1] as String?
+ fun fromList(pigeonVar_list: List): FlutterImageLinks {
+ val selfieImageUrl = pigeonVar_list[0] as String?
+ val error = pigeonVar_list[1] as String?
return FlutterImageLinks(selfieImageUrl, error)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
selfieImageUrl,
error,
)
@@ -659,17 +1026,16 @@ data class FlutterImageLinks (
/** Generated class from Pigeon that represents data sent in messages. */
data class FlutterAntifraud (
val suspectUsers: List
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterAntifraud {
- val suspectUsers = list[0] as List
+ fun fromList(pigeonVar_list: List): FlutterAntifraud {
+ val suspectUsers = pigeonVar_list[0] as List
return FlutterAntifraud(suspectUsers)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
suspectUsers,
)
}
@@ -679,18 +1045,17 @@ data class FlutterAntifraud (
data class FlutterSuspectUser (
val reason: String,
val userId: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterSuspectUser {
- val reason = list[0] as String
- val userId = list[1] as String
+ fun fromList(pigeonVar_list: List): FlutterSuspectUser {
+ val reason = pigeonVar_list[0] as String
+ val userId = pigeonVar_list[1] as String
return FlutterSuspectUser(reason, userId)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
reason,
userId,
)
@@ -706,23 +1071,22 @@ data class FlutterJobStatusRequest (
val partnerId: String,
val timestamp: String,
val signature: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterJobStatusRequest {
- val userId = list[0] as String
- val jobId = list[1] as String
- val includeImageLinks = list[2] as Boolean
- val includeHistory = list[3] as Boolean
- val partnerId = list[4] as String
- val timestamp = list[5] as String
- val signature = list[6] as String
+ fun fromList(pigeonVar_list: List): FlutterJobStatusRequest {
+ val userId = pigeonVar_list[0] as String
+ val jobId = pigeonVar_list[1] as String
+ val includeImageLinks = pigeonVar_list[2] as Boolean
+ val includeHistory = pigeonVar_list[3] as Boolean
+ val partnerId = pigeonVar_list[4] as String
+ val timestamp = pigeonVar_list[5] as String
+ val signature = pigeonVar_list[6] as String
return FlutterJobStatusRequest(userId, jobId, includeImageLinks, includeHistory, partnerId, timestamp, signature)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
userId,
jobId,
includeImageLinks,
@@ -742,27 +1106,26 @@ data class FlutterSmartSelfieJobResult (
val smileJobId: String,
val partnerParams: FlutterPartnerParams,
val confidence: Double? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterSmartSelfieJobResult {
- val actions = FlutterActions.fromList(list[0] as List)
- val resultCode = list[1] as String
- val resultText = list[2] as String
- val smileJobId = list[3] as String
- val partnerParams = FlutterPartnerParams.fromList(list[4] as List)
- val confidence = list[5] as Double?
+ fun fromList(pigeonVar_list: List): FlutterSmartSelfieJobResult {
+ val actions = pigeonVar_list[0] as FlutterActions
+ val resultCode = pigeonVar_list[1] as String
+ val resultText = pigeonVar_list[2] as String
+ val smileJobId = pigeonVar_list[3] as String
+ val partnerParams = pigeonVar_list[4] as FlutterPartnerParams
+ val confidence = pigeonVar_list[5] as Double?
return FlutterSmartSelfieJobResult(actions, resultCode, resultText, smileJobId, partnerParams, confidence)
}
}
fun toList(): List {
- return listOf(
- actions.toList(),
+ return listOf(
+ actions,
resultCode,
resultText,
smileJobId,
- partnerParams.toList(),
+ partnerParams,
confidence,
)
}
@@ -778,36 +1141,31 @@ data class FlutterSmartSelfieJobStatusResponse (
val resultString: String? = null,
val history: List? = null,
val imageLinks: FlutterImageLinks? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterSmartSelfieJobStatusResponse {
- val timestamp = list[0] as String
- val jobComplete = list[1] as Boolean
- val jobSuccess = list[2] as Boolean
- val code = list[3] as String
- val result: FlutterSmartSelfieJobResult? = (list[4] as List?)?.let {
- FlutterSmartSelfieJobResult.fromList(it)
- }
- val resultString = list[5] as String?
- val history = list[6] as List?
- val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let {
- FlutterImageLinks.fromList(it)
- }
+ fun fromList(pigeonVar_list: List): FlutterSmartSelfieJobStatusResponse {
+ val timestamp = pigeonVar_list[0] as String
+ val jobComplete = pigeonVar_list[1] as Boolean
+ val jobSuccess = pigeonVar_list[2] as Boolean
+ val code = pigeonVar_list[3] as String
+ val result = pigeonVar_list[4] as FlutterSmartSelfieJobResult?
+ val resultString = pigeonVar_list[5] as String?
+ val history = pigeonVar_list[6] as List?
+ val imageLinks = pigeonVar_list[7] as FlutterImageLinks?
return FlutterSmartSelfieJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
timestamp,
jobComplete,
jobSuccess,
code,
- result?.toList(),
+ result,
resultString,
history,
- imageLinks?.toList(),
+ imageLinks,
)
}
}
@@ -824,34 +1182,33 @@ data class FlutterSmartSelfieResponse (
val status: FlutterSmartSelfieStatus,
val updatedAt: String,
val userId: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterSmartSelfieResponse {
- val code = list[0] as String
- val createdAt = list[1] as String
- val jobId = list[2] as String
- val jobType = FlutterJobTypeV2.ofRaw(list[3] as Int)!!
- val message = list[4] as String
- val partnerId = list[5] as String
- val partnerParams = list[6] as Map?
- val status = FlutterSmartSelfieStatus.ofRaw(list[7] as Int)!!
- val updatedAt = list[8] as String
- val userId = list[9] as String
+ fun fromList(pigeonVar_list: List): FlutterSmartSelfieResponse {
+ val code = pigeonVar_list[0] as String
+ val createdAt = pigeonVar_list[1] as String
+ val jobId = pigeonVar_list[2] as String
+ val jobType = pigeonVar_list[3] as FlutterJobTypeV2
+ val message = pigeonVar_list[4] as String
+ val partnerId = pigeonVar_list[5] as String
+ val partnerParams = pigeonVar_list[6] as Map?
+ val status = pigeonVar_list[7] as FlutterSmartSelfieStatus
+ val updatedAt = pigeonVar_list[8] as String
+ val userId = pigeonVar_list[9] as String
return FlutterSmartSelfieResponse(code, createdAt, jobId, jobType, message, partnerId, partnerParams, status, updatedAt, userId)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
code,
createdAt,
jobId,
- jobType.raw,
+ jobType,
message,
partnerId,
partnerParams,
- status.raw,
+ status,
updatedAt,
userId,
)
@@ -876,37 +1233,36 @@ data class FlutterDocumentVerificationJobResult (
val phoneNumber: String? = null,
val phoneNumber2: String? = null,
val address: String? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterDocumentVerificationJobResult {
- val actions = FlutterActions.fromList(list[0] as List)
- val resultCode = list[1] as String
- val resultText = list[2] as String
- val smileJobId = list[3] as String
- val partnerParams = FlutterPartnerParams.fromList(list[4] as List)
- val country = list[5] as String?
- val idType = list[6] as String?
- val idNumber = list[7] as String?
- val fullName = list[8] as String?
- val dob = list[9] as String?
- val gender = list[10] as String?
- val expirationDate = list[11] as String?
- val documentImageBase64 = list[12] as String?
- val phoneNumber = list[13] as String?
- val phoneNumber2 = list[14] as String?
- val address = list[15] as String?
+ fun fromList(pigeonVar_list: List): FlutterDocumentVerificationJobResult {
+ val actions = pigeonVar_list[0] as FlutterActions
+ val resultCode = pigeonVar_list[1] as String
+ val resultText = pigeonVar_list[2] as String
+ val smileJobId = pigeonVar_list[3] as String
+ val partnerParams = pigeonVar_list[4] as FlutterPartnerParams
+ val country = pigeonVar_list[5] as String?
+ val idType = pigeonVar_list[6] as String?
+ val idNumber = pigeonVar_list[7] as String?
+ val fullName = pigeonVar_list[8] as String?
+ val dob = pigeonVar_list[9] as String?
+ val gender = pigeonVar_list[10] as String?
+ val expirationDate = pigeonVar_list[11] as String?
+ val documentImageBase64 = pigeonVar_list[12] as String?
+ val phoneNumber = pigeonVar_list[13] as String?
+ val phoneNumber2 = pigeonVar_list[14] as String?
+ val address = pigeonVar_list[15] as String?
return FlutterDocumentVerificationJobResult(actions, resultCode, resultText, smileJobId, partnerParams, country, idType, idNumber, fullName, dob, gender, expirationDate, documentImageBase64, phoneNumber, phoneNumber2, address)
}
}
fun toList(): List {
- return listOf(
- actions.toList(),
+ return listOf(
+ actions,
resultCode,
resultText,
smileJobId,
- partnerParams.toList(),
+ partnerParams,
country,
idType,
idNumber,
@@ -932,36 +1288,31 @@ data class FlutterDocumentVerificationJobStatusResponse (
val resultString: String? = null,
val history: List? = null,
val imageLinks: FlutterImageLinks? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterDocumentVerificationJobStatusResponse {
- val timestamp = list[0] as String
- val jobComplete = list[1] as Boolean
- val jobSuccess = list[2] as Boolean
- val code = list[3] as String
- val result: FlutterDocumentVerificationJobResult? = (list[4] as List?)?.let {
- FlutterDocumentVerificationJobResult.fromList(it)
- }
- val resultString = list[5] as String?
- val history = list[6] as List?
- val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let {
- FlutterImageLinks.fromList(it)
- }
+ fun fromList(pigeonVar_list: List): FlutterDocumentVerificationJobStatusResponse {
+ val timestamp = pigeonVar_list[0] as String
+ val jobComplete = pigeonVar_list[1] as Boolean
+ val jobSuccess = pigeonVar_list[2] as Boolean
+ val code = pigeonVar_list[3] as String
+ val result = pigeonVar_list[4] as FlutterDocumentVerificationJobResult?
+ val resultString = pigeonVar_list[5] as String?
+ val history = pigeonVar_list[6] as List?
+ val imageLinks = pigeonVar_list[7] as FlutterImageLinks?
return FlutterDocumentVerificationJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
timestamp,
jobComplete,
jobSuccess,
code,
- result?.toList(),
+ result,
resultString,
history,
- imageLinks?.toList(),
+ imageLinks,
)
}
}
@@ -991,48 +1342,45 @@ data class FlutterBiometricKycJobResult (
val secondaryIdNumber: String? = null,
val idNumberPreviouslyRegistered: Boolean? = null,
val previousRegistrantsUserIds: List? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterBiometricKycJobResult {
- val actions = FlutterActions.fromList(list[0] as List)
- val resultCode = list[1] as String
- val resultText = list[2] as String
- val resultType = list[3] as String
- val smileJobId = list[4] as String
- val partnerParams = FlutterPartnerParams.fromList(list[5] as List)
- val antifraud: FlutterAntifraud? = (list[6] as List?)?.let {
- FlutterAntifraud.fromList(it)
- }
- val dob = list[7] as String?
- val photoBase64 = list[8] as String?
- val gender = list[9] as String?
- val idType = list[10] as String?
- val address = list[11] as String?
- val country = list[12] as String?
- val documentImageBase64 = list[13] as String?
- val fullData = list[14] as Map?
- val fullName = list[15] as String?
- val idNumber = list[16] as String?
- val phoneNumber = list[17] as String?
- val phoneNumber2 = list[18] as String?
- val expirationDate = list[19] as String?
- val secondaryIdNumber = list[20] as String?
- val idNumberPreviouslyRegistered = list[21] as Boolean?
- val previousRegistrantsUserIds = list[22] as List?
+ fun fromList(pigeonVar_list: List): FlutterBiometricKycJobResult {
+ val actions = pigeonVar_list[0] as FlutterActions
+ val resultCode = pigeonVar_list[1] as String
+ val resultText = pigeonVar_list[2] as String
+ val resultType = pigeonVar_list[3] as String
+ val smileJobId = pigeonVar_list[4] as String
+ val partnerParams = pigeonVar_list[5] as FlutterPartnerParams
+ val antifraud = pigeonVar_list[6] as FlutterAntifraud?
+ val dob = pigeonVar_list[7] as String?
+ val photoBase64 = pigeonVar_list[8] as String?
+ val gender = pigeonVar_list[9] as String?
+ val idType = pigeonVar_list[10] as String?
+ val address = pigeonVar_list[11] as String?
+ val country = pigeonVar_list[12] as String?
+ val documentImageBase64 = pigeonVar_list[13] as String?
+ val fullData = pigeonVar_list[14] as Map?
+ val fullName = pigeonVar_list[15] as String?
+ val idNumber = pigeonVar_list[16] as String?
+ val phoneNumber = pigeonVar_list[17] as String?
+ val phoneNumber2 = pigeonVar_list[18] as String?
+ val expirationDate = pigeonVar_list[19] as String?
+ val secondaryIdNumber = pigeonVar_list[20] as String?
+ val idNumberPreviouslyRegistered = pigeonVar_list[21] as Boolean?
+ val previousRegistrantsUserIds = pigeonVar_list[22] as List?
return FlutterBiometricKycJobResult(actions, resultCode, resultText, resultType, smileJobId, partnerParams, antifraud, dob, photoBase64, gender, idType, address, country, documentImageBase64, fullData, fullName, idNumber, phoneNumber, phoneNumber2, expirationDate, secondaryIdNumber, idNumberPreviouslyRegistered, previousRegistrantsUserIds)
}
}
fun toList(): List {
- return listOf(
- actions.toList(),
+ return listOf(
+ actions,
resultCode,
resultText,
resultType,
smileJobId,
- partnerParams.toList(),
- antifraud?.toList(),
+ partnerParams,
+ antifraud,
dob,
photoBase64,
gender,
@@ -1063,36 +1411,31 @@ data class FlutterBiometricKycJobStatusResponse (
val resultString: String? = null,
val history: List? = null,
val imageLinks: FlutterImageLinks? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterBiometricKycJobStatusResponse {
- val timestamp = list[0] as String
- val jobComplete = list[1] as Boolean
- val jobSuccess = list[2] as Boolean
- val code = list[3] as String
- val result: FlutterBiometricKycJobResult? = (list[4] as List?)?.let {
- FlutterBiometricKycJobResult.fromList(it)
- }
- val resultString = list[5] as String?
- val history = list[6] as List?
- val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let {
- FlutterImageLinks.fromList(it)
- }
+ fun fromList(pigeonVar_list: List): FlutterBiometricKycJobStatusResponse {
+ val timestamp = pigeonVar_list[0] as String
+ val jobComplete = pigeonVar_list[1] as Boolean
+ val jobSuccess = pigeonVar_list[2] as Boolean
+ val code = pigeonVar_list[3] as String
+ val result = pigeonVar_list[4] as FlutterBiometricKycJobResult?
+ val resultString = pigeonVar_list[5] as String?
+ val history = pigeonVar_list[6] as List?
+ val imageLinks = pigeonVar_list[7] as FlutterImageLinks?
return FlutterBiometricKycJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
timestamp,
jobComplete,
jobSuccess,
code,
- result?.toList(),
+ result,
resultString,
history,
- imageLinks?.toList(),
+ imageLinks,
)
}
}
@@ -1122,48 +1465,45 @@ data class FlutterEnhancedDocumentVerificationJobResult (
val secondaryIdNumber: String? = null,
val idNumberPreviouslyRegistered: Boolean? = null,
val previousRegistrantsUserIds: List? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterEnhancedDocumentVerificationJobResult {
- val actions = FlutterActions.fromList(list[0] as List)
- val resultCode = list[1] as String
- val resultText = list[2] as String
- val resultType = list[3] as String
- val smileJobId = list[4] as String
- val partnerParams = FlutterPartnerParams.fromList(list[5] as List)
- val antifraud: FlutterAntifraud? = (list[6] as List?)?.let {
- FlutterAntifraud.fromList(it)
- }
- val dob = list[7] as String?
- val photoBase64 = list[8] as String?
- val gender = list[9] as String?
- val idType = list[10] as String?
- val address = list[11] as String?
- val country = list[12] as String?
- val documentImageBase64 = list[13] as String?
- val fullData = list[14] as Map?
- val fullName = list[15] as String?
- val idNumber = list[16] as String?
- val phoneNumber = list[17] as String?
- val phoneNumber2 = list[18] as String?
- val expirationDate = list[19] as String?
- val secondaryIdNumber = list[20] as String?
- val idNumberPreviouslyRegistered = list[21] as Boolean?
- val previousRegistrantsUserIds = list[22] as List?
+ fun fromList(pigeonVar_list: List): FlutterEnhancedDocumentVerificationJobResult {
+ val actions = pigeonVar_list[0] as FlutterActions
+ val resultCode = pigeonVar_list[1] as String
+ val resultText = pigeonVar_list[2] as String
+ val resultType = pigeonVar_list[3] as String
+ val smileJobId = pigeonVar_list[4] as String
+ val partnerParams = pigeonVar_list[5] as FlutterPartnerParams
+ val antifraud = pigeonVar_list[6] as FlutterAntifraud?
+ val dob = pigeonVar_list[7] as String?
+ val photoBase64 = pigeonVar_list[8] as String?
+ val gender = pigeonVar_list[9] as String?
+ val idType = pigeonVar_list[10] as String?
+ val address = pigeonVar_list[11] as String?
+ val country = pigeonVar_list[12] as String?
+ val documentImageBase64 = pigeonVar_list[13] as String?
+ val fullData = pigeonVar_list[14] as Map?
+ val fullName = pigeonVar_list[15] as String?
+ val idNumber = pigeonVar_list[16] as String?
+ val phoneNumber = pigeonVar_list[17] as String?
+ val phoneNumber2 = pigeonVar_list[18] as String?
+ val expirationDate = pigeonVar_list[19] as String?
+ val secondaryIdNumber = pigeonVar_list[20] as String?
+ val idNumberPreviouslyRegistered = pigeonVar_list[21] as Boolean?
+ val previousRegistrantsUserIds = pigeonVar_list[22] as List?
return FlutterEnhancedDocumentVerificationJobResult(actions, resultCode, resultText, resultType, smileJobId, partnerParams, antifraud, dob, photoBase64, gender, idType, address, country, documentImageBase64, fullData, fullName, idNumber, phoneNumber, phoneNumber2, expirationDate, secondaryIdNumber, idNumberPreviouslyRegistered, previousRegistrantsUserIds)
}
}
fun toList(): List {
- return listOf(
- actions.toList(),
+ return listOf(
+ actions,
resultCode,
resultText,
resultType,
smileJobId,
- partnerParams.toList(),
- antifraud?.toList(),
+ partnerParams,
+ antifraud,
dob,
photoBase64,
gender,
@@ -1194,36 +1534,31 @@ data class FlutterEnhancedDocumentVerificationJobStatusResponse (
val resultString: String? = null,
val history: List? = null,
val imageLinks: FlutterImageLinks? = null
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterEnhancedDocumentVerificationJobStatusResponse {
- val timestamp = list[0] as String
- val jobComplete = list[1] as Boolean
- val jobSuccess = list[2] as Boolean
- val code = list[3] as String
- val result: FlutterEnhancedDocumentVerificationJobResult? = (list[4] as List?)?.let {
- FlutterEnhancedDocumentVerificationJobResult.fromList(it)
- }
- val resultString = list[5] as String?
- val history = list[6] as List?
- val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let {
- FlutterImageLinks.fromList(it)
- }
+ fun fromList(pigeonVar_list: List): FlutterEnhancedDocumentVerificationJobStatusResponse {
+ val timestamp = pigeonVar_list[0] as String
+ val jobComplete = pigeonVar_list[1] as Boolean
+ val jobSuccess = pigeonVar_list[2] as Boolean
+ val code = pigeonVar_list[3] as String
+ val result = pigeonVar_list[4] as FlutterEnhancedDocumentVerificationJobResult?
+ val resultString = pigeonVar_list[5] as String?
+ val history = pigeonVar_list[6] as List?
+ val imageLinks = pigeonVar_list[7] as FlutterImageLinks?
return FlutterEnhancedDocumentVerificationJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
timestamp,
jobComplete,
jobSuccess,
code,
- result?.toList(),
+ result,
resultString,
history,
- imageLinks?.toList(),
+ imageLinks,
)
}
}
@@ -1233,19 +1568,18 @@ data class FlutterProductsConfigRequest (
val partnerId: String,
val timestamp: String,
val signature: String
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterProductsConfigRequest {
- val partnerId = list[0] as String
- val timestamp = list[1] as String
- val signature = list[2] as String
+ fun fromList(pigeonVar_list: List): FlutterProductsConfigRequest {
+ val partnerId = pigeonVar_list[0] as String
+ val timestamp = pigeonVar_list[1] as String
+ val signature = pigeonVar_list[2] as String
return FlutterProductsConfigRequest(partnerId, timestamp, signature)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
partnerId,
timestamp,
signature,
@@ -1257,20 +1591,19 @@ data class FlutterProductsConfigRequest (
data class FlutterProductsConfigResponse (
val consentRequired: Map?>,
val idSelection: FlutterIdSelection
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterProductsConfigResponse {
- val consentRequired = list[0] as Map?>
- val idSelection = FlutterIdSelection.fromList(list[1] as List)
+ fun fromList(pigeonVar_list: List): FlutterProductsConfigResponse {
+ val consentRequired = pigeonVar_list[0] as Map?>
+ val idSelection = pigeonVar_list[1] as FlutterIdSelection
return FlutterProductsConfigResponse(consentRequired, idSelection)
}
}
fun toList(): List {
- return listOf(
+ return listOf(
consentRequired,
- idSelection.toList(),
+ idSelection,
)
}
}
@@ -1281,20 +1614,19 @@ data class FlutterIdSelection (
val biometricKyc: Map?>,
val enhancedKyc: Map?>,
val documentVerification: Map?>
-
-) {
+)
+ {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List): FlutterIdSelection {
- val basicKyc = list[0] as Map?>
- val biometricKyc = list[1] as Map?>
- val enhancedKyc = list[2] as Map?>
- val documentVerification = list[3] as Map?>
+ fun fromList(pigeonVar_list: List): FlutterIdSelection {
+ val basicKyc = pigeonVar_list[0] as Map?>
+ val biometricKyc = pigeonVar_list[1] as Map?>
+ val enhancedKyc = pigeonVar_list[2] as Map?>
+ val documentVerification = pigeonVar_list[3] as Map?>
return FlutterIdSelection(basicKyc, biometricKyc, enhancedKyc, documentVerification)
}
}
fun toList(): List