Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added agent mode on DocV and EnhancedDocV #95

Merged
merged 4 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Biometric KYC
- Consent Screen
- BVN OTP API calls and models
- Added `allowAgentMode` option on Document Verification and Enhanced Document Verification

### Changed
- Default to `production` on `SmileID.initialize()`
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- netfox (1.21.0)
- SmileID (10.0.0-beta07):
- SmileID (10.0.0-beta10):
- Zip (~> 2.1.0)
- SwiftLint (0.52.4)
- Zip (2.1.2)
Expand All @@ -22,7 +22,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7
SmileID: 75e58d498ba4dfdd2c37510fe43f82423051faa5
SmileID: 5975f6130f357bfa08e9b1f731f9ce3e2d91c216
SwiftLint: 1cc5cd61ba9bacb2194e340aeb47a2a37fda00b3
Zip: b3fef584b147b6e582b2256a9815c897d60ddc67

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct OrchestratedDocumentVerificationScreen: View {
let jobId: String
let showAttribution: Bool
let allowGalleryUpload: Bool
let allowAgentMode: Bool
let showInstructions: Bool
let onResult: DocumentVerificationResultDelegate

Expand All @@ -24,6 +25,7 @@ struct OrchestratedDocumentVerificationScreen: View {
jobId: jobId,
showAttribution: showAttribution,
allowGalleryUpload: allowGalleryUpload,
allowAgentMode: allowAgentMode,
showInstructions: showInstructions,
onResult: onResult,
viewModel: OrchestratedDocumentVerificationViewModel(
Expand All @@ -49,6 +51,7 @@ struct OrchestratedEnhancedDocumentVerificationScreen: View {
let jobId: String
let showAttribution: Bool
let allowGalleryUpload: Bool
let allowAgentMode: Bool
let showInstructions: Bool
let onResult: EnhancedDocumentVerificationResultDelegate

Expand All @@ -63,6 +66,7 @@ struct OrchestratedEnhancedDocumentVerificationScreen: View {
jobId: jobId,
showAttribution: showAttribution,
allowGalleryUpload: allowGalleryUpload,
allowAgentMode: allowAgentMode,
showInstructions: showInstructions,
onResult: onResult,
viewModel: OrchestratedEnhancedDocumentVerificationViewModel(
Expand All @@ -88,6 +92,7 @@ private struct IOrchestratedDocumentVerificationScreen<T, U: JobResult>: View {
let jobId: String
let showAttribution: Bool
let allowGalleryUpload: Bool
let allowAgentMode: Bool
let showInstructions: Bool
let onResult: T
@ObservedObject var viewModel: IOrchestratedDocumentVerificationViewModel<T, U>
Expand All @@ -102,6 +107,7 @@ private struct IOrchestratedDocumentVerificationScreen<T, U: JobResult>: View {
jobId: String,
showAttribution: Bool,
allowGalleryUpload: Bool,
allowAgentMode: Bool,
showInstructions: Bool,
onResult: T,
viewModel: IOrchestratedDocumentVerificationViewModel<T, U>
Expand All @@ -115,6 +121,7 @@ private struct IOrchestratedDocumentVerificationScreen<T, U: JobResult>: View {
self.jobId = jobId
self.showAttribution = showAttribution
self.allowGalleryUpload = allowGalleryUpload
self.allowAgentMode = allowAgentMode
self.showInstructions = showInstructions
self.onResult = onResult
self.viewModel = viewModel
Expand Down Expand Up @@ -163,6 +170,7 @@ private struct IOrchestratedDocumentVerificationScreen<T, U: JobResult>: View {
userId: userId,
jobId: jobId,
isEnroll: false,
allowsAgentMode: allowAgentMode,
shouldSubmitJob: false,
// imageCaptureDelegate is just for image capture, not job result
imageCaptureDelegate: viewModel
Expand Down
7 changes: 7 additions & 0 deletions Sources/SmileID/Classes/SmileID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public class SmileID {
idAspectRatio: Double? = nil,
bypassSelfieCaptureWithFile: URL? = nil,
captureBothSides: Bool = true,
allowAgentMode: Bool = false,
allowGalleryUpload: Bool = false,
showInstructions: Bool = true,
showAttribution: Bool = true,
Expand All @@ -220,6 +221,7 @@ public class SmileID {
jobId: jobId,
showAttribution: showAttribution,
allowGalleryUpload: allowGalleryUpload,
allowAgentMode: allowAgentMode,
showInstructions: showInstructions,
onResult: delegate
).environmentObject(router)
Expand All @@ -242,6 +244,9 @@ public class SmileID {
/// - captureBothSides: Whether to capture both sides of the ID or not. Otherwise, only the
/// front side will be captured. If this is true, an option to skip back side will still be
/// shown
/// - 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.
/// - allowGalleryUpload: Whether to allow the user to upload images from their gallery or not
/// - showInstructions: Whether to deactivate capture screen's instructions for Document
/// Verification (NB! If instructions are disabled, gallery upload won't be possible)
Expand All @@ -255,6 +260,7 @@ public class SmileID {
idAspectRatio: Double? = nil,
bypassSelfieCaptureWithFile: URL? = nil,
captureBothSides: Bool = true,
allowAgentMode: Bool = false,
allowGalleryUpload: Bool = false,
showInstructions: Bool = true,
showAttribution: Bool = true,
Expand All @@ -270,6 +276,7 @@ public class SmileID {
jobId: jobId,
showAttribution: showAttribution,
allowGalleryUpload: allowGalleryUpload,
allowAgentMode: allowAgentMode,
showInstructions: showInstructions,
onResult: delegate
).environmentObject(router)
Expand Down
Loading