Skip to content

Commit

Permalink
added allowAgentMode on docv and enhanced docv (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
jumaallan authored Nov 14, 2023
1 parent b82b16a commit 4c18abb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 10.0.0-beta13 (unreleased)

### Added
- Added `allowAgentMode` option on Document Verification and Enhanced Document Verification

### Fixed

Expand Down
10 changes: 10 additions & 0 deletions lib/src/main/java/com/smileidentity/compose/SmileIDExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ fun SmileID.SmartSelfieAuthentication(
* correspond to a unique Job ID within your own system. If not provided, a random job ID will be
* generated
* @param showAttribution Whether to show the Smile ID attribution or not on the Instructions screen
* @param allowAgentMode Whether to allow Agent Mode or not. If allowed, a switch will be displayed
* allowing toggling between the back camera and front camera. If not allowed, only the front
* camera will be used.
* @param allowGalleryUpload Whether to allow the user to upload images from their gallery or not
* @param showInstructions Whether to deactivate capture screen's instructions for Document
* Verification (NB! If instructions are disabled, gallery upload won't be possible)
Expand All @@ -167,6 +170,7 @@ fun SmileID.DocumentVerification(
userId: String = rememberSaveable { randomUserId() },
jobId: String = rememberSaveable { randomJobId() },
showAttribution: Boolean = true,
allowAgentMode: Boolean = false,
allowGalleryUpload: Boolean = false,
showInstructions: Boolean = true,
colorScheme: ColorScheme = SmileID.colorScheme,
Expand All @@ -180,6 +184,7 @@ fun SmileID.DocumentVerification(
userId = userId,
jobId = jobId,
showAttribution = showAttribution,
allowAgentMode = allowAgentMode,
allowGalleryUpload = allowGalleryUpload,
showInstructions = showInstructions,
idAspectRatio = idAspectRatio,
Expand Down Expand Up @@ -221,6 +226,9 @@ fun SmileID.DocumentVerification(
* correspond to a unique Job ID within your own system. If not provided, a random job ID will be
* generated
* @param showAttribution Whether to show the Smile ID attribution or not on the Instructions screen
* @param allowAgentMode Whether to allow Agent Mode or not. If allowed, a switch will be displayed
* allowing toggling between the back camera and front camera. If not allowed, only the front
* camera will be used.
* @param allowGalleryUpload Whether to allow the user to upload images from their gallery or not
* @param showInstructions Whether to deactivate capture screen's instructions for Document
* Verification (NB! If instructions are disabled, gallery upload won't be possible)
Expand All @@ -240,6 +248,7 @@ fun SmileID.EnhancedDocumentVerificationScreen(
userId: String = rememberSaveable { randomUserId() },
jobId: String = rememberSaveable { randomJobId() },
showAttribution: Boolean = true,
allowAgentMode: Boolean = false,
allowGalleryUpload: Boolean = false,
showInstructions: Boolean = true,
colorScheme: ColorScheme = SmileID.colorScheme,
Expand All @@ -253,6 +262,7 @@ fun SmileID.EnhancedDocumentVerificationScreen(
userId = userId,
jobId = jobId,
showAttribution = showAttribution,
allowAgentMode = allowAgentMode,
allowGalleryUpload = allowGalleryUpload,
showInstructions = showInstructions,
idAspectRatio = idAspectRatio,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ internal fun <T : Parcelable> OrchestratedDocumentVerificationScreen(
userId: String = rememberSaveable { randomUserId() },
jobId: String = rememberSaveable { randomJobId() },
showAttribution: Boolean = true,
allowAgentMode: Boolean = false,
allowGalleryUpload: Boolean = false,
showInstructions: Boolean = true,
onResult: SmileIDCallback<T> = {},
Expand Down Expand Up @@ -90,7 +91,7 @@ internal fun <T : Parcelable> OrchestratedDocumentVerificationScreen(
userId = userId,
jobId = jobId,
isEnroll = false,
allowAgentMode = false,
allowAgentMode = allowAgentMode,
showAttribution = showAttribution,
showInstructions = showInstructions,
skipApiSubmission = true,
Expand Down

0 comments on commit 4c18abb

Please sign in to comment.