Skip to content

Commit

Permalink
feat: consistent file paths (#122)
Browse files Browse the repository at this point in the history
* feat: consistent file paths

* feat: consistent file paths

* feat: consistent file paths

* fix: lint

* fix: lint

* fix: lint

* feat: lint

* downgrade native android

* feat: lint

* feat: pr feedback

* feat: android kotlin fixed version

* chore: bump version to 10.2.1 and update changelog

* chore: remove snapshots

* feature: bump target sdk to version to 35
  • Loading branch information
JNdhlovu authored Nov 20, 2024
1 parent 68634da commit bcfe7dd
Show file tree
Hide file tree
Showing 32 changed files with 466 additions and 142 deletions.
42 changes: 31 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
# Release Notes

## 10.2.1

* Allow skipApiSubmission which will capture Enrollment, Authentication, Doc V and Enhanced DocV
without submitting to SmileID and will return captured images file paths
* Fix Consistent file paths for all products and capture screens
* Bump android to 10.3.7 (https://github.com/smileidentity/android/releases/tag/v10.3.7)
* Bump iOS to 10.2.17 (https://github.com/smileidentity/ios/releases/tag/v10.2.17)

## 10.2.0

* Remove `jobId` in selfie jobs. This is now passed inside `extraPartnerParams`

## 10.1.10

* Added selfie capture screens
* Added document capture screens
* Bump iOS to 10.2.12 (https://github.com/smileidentity/ios/releases/tag/v10.2.12)
* Update AGP versions

## 10.1.9
## 10.1.9

* Bump Android to 10.3.1 (https://github.com/smileidentity/android/releases/tag/v10.3.1)
* Bump iOS to 10.2.10 (https://github.com/smileidentity/ios/releases/tag/v10.2.10)

## 10.1.8

* Fix API Config to provide different options to configure SmileID
* Bump ios to 10.2.8 (https://github.com/smileidentity/ios/releases/tag/v10.2.8) In memory zip file handling
* Bump ios to 10.2.8 (https://github.com/smileidentity/ios/releases/tag/v10.2.8) In memory zip file
handling

## 10.1.7

Expand All @@ -33,11 +46,12 @@

## 10.1.5

* Fix navigation issue on iOS Flutter app
* Fix navigation issue on iOS Flutter app

## 10.1.4

* Bump iOS to 10.2.2 (https://github.com/smileidentity/ios/releases/tag/v10.2.2) which fixes retry crash)
* Bump iOS to 10.2.2 (https://github.com/smileidentity/ios/releases/tag/v10.2.2) which fixes retry
crash)

## 10.1.3

Expand All @@ -54,21 +68,24 @@

## 10.1.0

* Moved SmartSelfie enrollment and authentication to synchronous endpoints
* Moved SmartSelfie enrollment and authentication to synchronous endpoints
* Introduced polling methods for products
* SmartSelfie
* SmartSelfie
* Biometric kyc
* Document verification
* Enhanced document verification
* Added an Offline Mode, enabled by calling `SmileID.setAllowOfflineMode(true)`. If a job is attempted while the device is offline, and offline mode has been enabled, the UI will complete successfully and the job can be submitted at a later time by calling `SmileID.submitJob(jobId)`
* Added an Offline Mode, enabled by calling `SmileID.setAllowOfflineMode(true)`. If a job is
attempted while the device is offline, and offline mode has been enabled, the UI will complete
successfully and the job can be submitted at a later time by calling `SmileID.submitJob(jobId)`
* Improved SmartSelfie Enrollment and Authentication times by moving to a synchronous API endpoint
* Update generic errors with actual platform errors
* Bump iOS to 10.1.6 (https://github.com/smileidentity/ios/releases/tag/v10.1.6)
* Bump Android to 10.1.6 (https://github.com/smileidentity/android/releases/tag/v10.1.6)

## 10.0.12

* Fixed a bug where SmartSelfieEnrollment and SmartSelfieAuthentication would return invalid `livenessImages` in `onSuccess`
* Fixed a bug where SmartSelfieEnrollment and SmartSelfieAuthentication would return invalid
`livenessImages` in `onSuccess`

## 10.0.11

Expand All @@ -94,12 +111,14 @@

## 10.0.6

* Fixed a bug where Android builds would not compile when the partner app (or a library they consume) also uses `Pigeon` under the hood
* Fixed a bug where Android builds would not compile when the partner app (or a library they
consume) also uses `Pigeon` under the hood
* Updated generated files naming to prefix `SmileID` and prevent build duplicate class erros

## 10.0.5

* Fixed a bug where Android builds would not compile when the partner app (or a library they consume) also uses `Pigeon` under the hood
* Fixed a bug where Android builds would not compile when the partner app (or a library they
consume) also uses `Pigeon` under the hood
* Bumped Android and iOS versions

## 10.0.4
Expand Down Expand Up @@ -147,7 +166,8 @@

* \[Android] Added `extras` as optional params on all job types
* \[Android] Added `idAuthorityBypassPhoto` on Sandbox BiometricKYC jobs
* \[Android] Added `allowAgentMode` option on Document Verification and Enhanced Document Verification
* \[Android] Added `allowAgentMode` option on Document Verification and Enhanced Document
Verification
* \[Flutter] Fixed wrong iOS decoding bug on success

## 10.0.0-beta05
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ apply plugin: "org.jlleitschuh.gradle.ktlint"

android {
namespace group
compileSdk 34
compileSdk 35

defaultConfig {
minSdk 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.content.Context
import androidx.compose.runtime.Composable
import com.smileidentity.SmileID
import com.smileidentity.compose.BiometricKYC
import com.smileidentity.flutter.results.SmartSelfieCaptureResult
import com.smileidentity.flutter.utils.SelfieCaptureResultAdapter
import com.smileidentity.models.IdInfo
import com.smileidentity.results.SmileIDResult
import com.smileidentity.util.randomJobId
Expand Down Expand Up @@ -49,7 +51,32 @@ internal class SmileIDBiometricKYC private constructor(
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
when (it) {
is SmileIDResult.Success -> onSuccess(it.data)
is SmileIDResult.Success -> {
val result =
SmartSelfieCaptureResult(
selfieFile = it.data.selfieFile,
livenessFiles = it.data.livenessFiles,
didSubmitBiometricKycJob = it.data.didSubmitBiometricKycJob,
)
val moshi =
SmileID.moshi
.newBuilder()
.add(SelfieCaptureResultAdapter.FACTORY)
.build()
val json =
try {
moshi
.adapter(SmartSelfieCaptureResult::class.java)
.toJson(result)
} catch (e: Exception) {
onError(e)
return@BiometricKYC
}
json?.let { js ->
onSuccessJson(js)
}
}

is SmileIDResult.Error -> onError(it.throwable)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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.flutter.results.DocumentCaptureResult
import com.smileidentity.flutter.utils.DocumentCaptureResultAdapter
import com.smileidentity.models.v2.Metadata
import com.smileidentity.util.randomJobId
Expand All @@ -26,11 +27,6 @@ import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory
import java.io.File

data class DocumentCaptureResult(
val documentFrontFile: File? = null,
val documentBackFile: File? = null,
)

internal class SmileIDDocumentCaptureView private constructor(
context: Context,
viewId: Int,
Expand Down Expand Up @@ -111,19 +107,10 @@ internal class SmileIDDocumentCaptureView private constructor(
modifier = Modifier.fillMaxSize(),
jobId = jobId,
side = if (isDocumentFrontSide) DocumentCaptureSide.Front else DocumentCaptureSide.Back,
showInstructions = showInstructions,
showAttribution = showAttribution,
allowGallerySelection = allowGalleryUpload,
showSkipButton = false,
instructionsHeroImage = hero,
showConfirmation = showConfirmationDialog,
instructionsTitleText = stringResource(instructionTitle),
instructionsSubtitleText = stringResource(instructionSubTitle),
captureTitleText = stringResource(captureTitleText),
knownIdAspectRatio = idAspectRatio,
onConfirm = { file -> handleConfirmation(isDocumentFrontSide, file) },
onError = { throwable -> onError(throwable) },
onSkip = { },
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.content.Context
import androidx.compose.runtime.Composable
import com.smileidentity.SmileID
import com.smileidentity.compose.DocumentVerification
import com.smileidentity.flutter.results.DocumentCaptureResult
import com.smileidentity.flutter.utils.DocumentCaptureResultAdapter
import com.smileidentity.results.SmileIDResult
import com.smileidentity.util.randomJobId
import com.smileidentity.util.randomUserId
Expand Down Expand Up @@ -33,18 +35,47 @@ internal class SmileIDDocumentVerification private constructor(
idAspectRatio = (args["idAspectRatio"] as Double?)?.toFloat(),
captureBothSides = args["captureBothSides"] as? Boolean ?: true,
bypassSelfieCaptureWithFile =
(args["bypassSelfieCaptureWithFile"] as? String)?.let { File(it) },
(args["bypassSelfieCaptureWithFile"] as? String)?.let {
File(it)
},
userId = args["userId"] as? String ?: randomUserId(),
jobId = args["jobId"] as? String ?: randomJobId(),
allowNewEnroll = args["allowNewEnroll"] as? Boolean ?: false,
showAttribution = args["showAttribution"] as? Boolean ?: true,
allowAgentMode = args["allowAgentMode"] as? Boolean ?: false,
allowGalleryUpload = args["allowGalleryUpload"] as? Boolean ?: false,
showInstructions = args["showInstructions"] as? Boolean ?: true,
skipApiSubmission = args["skipApiSubmission"] as? Boolean ?: false,
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
when (it) {
is SmileIDResult.Success -> onSuccess(it.data)
is SmileIDResult.Success -> {
val result =
DocumentCaptureResult(
selfieFile = it.data.selfieFile,
documentFrontFile = it.data.documentFrontFile,
livenessFiles = it.data.livenessFiles,
documentBackFile = it.data.documentBackFile,
didSubmitDocumentVerificationJob =
it.data.didSubmitDocumentVerificationJob,
)
val moshi =
SmileID.moshi
.newBuilder()
.add(DocumentCaptureResultAdapter.FACTORY)
.build()
val json =
try {
moshi.adapter(DocumentCaptureResult::class.java).toJson(result)
} catch (e: Exception) {
onError(e)
return@DocumentVerification
}
json?.let { js ->
onSuccessJson(js)
}
}

is SmileIDResult.Error -> onError(it.throwable)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.content.Context
import androidx.compose.runtime.Composable
import com.smileidentity.SmileID
import com.smileidentity.compose.EnhancedDocumentVerificationScreen
import com.smileidentity.flutter.results.DocumentCaptureResult
import com.smileidentity.flutter.utils.DocumentCaptureResultAdapter
import com.smileidentity.results.SmileIDResult
import com.smileidentity.util.randomJobId
import com.smileidentity.util.randomUserId
Expand Down Expand Up @@ -38,10 +40,38 @@ internal class SmileIDEnhancedDocumentVerification private constructor(
allowAgentMode = args["allowAgentMode"] as? Boolean ?: false,
allowGalleryUpload = args["allowGalleryUpload"] as? Boolean ?: false,
showInstructions = args["showInstructions"] as? Boolean ?: true,
skipApiSubmission = args["skipApiSubmission"] as? Boolean ?: false,
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
when (it) {
is SmileIDResult.Success -> onSuccess(it.data)
is SmileIDResult.Success -> {
val result =
DocumentCaptureResult(
selfieFile = it.data.selfieFile,
documentFrontFile = it.data.documentFrontFile,
livenessFiles = it.data.livenessFiles,
documentBackFile = it.data.documentBackFile,
didSubmitEnhancedDocVJob = it.data.didSubmitEnhancedDocVJob,
)
val moshi =
SmileID.moshi
.newBuilder()
.add(DocumentCaptureResultAdapter.FACTORY)
.build()
val json =
try {
moshi
.adapter(DocumentCaptureResult::class.java)
.toJson(result)
} catch (e: Exception) {
onError(e)
return@EnhancedDocumentVerificationScreen
}
json?.let { js ->
onSuccessJson(js)
}
}

is SmileIDResult.Error -> onError(it.throwable)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.content.Context
import androidx.compose.runtime.Composable
import com.smileidentity.SmileID
import com.smileidentity.compose.SmartSelfieAuthentication
import com.smileidentity.flutter.results.SmartSelfieCaptureResult
import com.smileidentity.flutter.utils.SelfieCaptureResultAdapter
import com.smileidentity.results.SmileIDResult
import com.smileidentity.util.randomUserId
import io.flutter.plugin.common.BinaryMessenger
Expand Down Expand Up @@ -31,10 +33,36 @@ internal class SmileIDSmartSelfieAuthentication private constructor(
allowAgentMode = args["allowAgentMode"] as? Boolean ?: false,
showAttribution = args["showAttribution"] as? Boolean ?: true,
showInstructions = args["showInstructions"] as? Boolean ?: true,
skipApiSubmission = args["skipApiSubmission"] as? Boolean ?: false,
extraPartnerParams = extraPartnerParams.toImmutableMap(),
) {
when (it) {
is SmileIDResult.Success -> onSuccess(it.data)
is SmileIDResult.Success -> {
val result =
SmartSelfieCaptureResult(
selfieFile = it.data.selfieFile,
livenessFiles = it.data.livenessFiles,
apiResponse = it.data.apiResponse,
)
val moshi =
SmileID.moshi
.newBuilder()
.add(SelfieCaptureResultAdapter.FACTORY)
.build()
val json =
try {
moshi
.adapter(SmartSelfieCaptureResult::class.java)
.toJson(result)
} catch (e: Exception) {
onError(e)
return@SmartSelfieAuthentication
}
json?.let { js ->
onSuccessJson(js)
}
}

is SmileIDResult.Error -> onError(it.throwable)
}
}
Expand Down
Loading

0 comments on commit bcfe7dd

Please sign in to comment.