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

feat: update changelog #254

Merged
merged 2 commits into from
Nov 18, 2024
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes

## 10.2.17
### Added skipApiSubmission: Whether to skip api submission to SmileID and return only captured images on SmartSelfie enrollment, SmartSelfie authentic , Document verification and Enhanced DocV

## 10.2.16
### Fixed
* Clear images on retry or start capture with the same jobId
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PODS:
- Sentry (8.36.0):
- Sentry/Core (= 8.36.0)
- Sentry/Core (8.36.0)
- SmileID (10.2.16):
- SmileID (10.2.17):
- FingerprintJS
- lottie-ios (~> 4.4.2)
- ZIPFoundation (~> 0.9)
Expand Down Expand Up @@ -51,7 +51,7 @@ SPEC CHECKSUMS:
lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418
netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7
Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57
SmileID: 3c6d3101c7da84fe9acc36c10d2a189192f00d13
SmileID: 44fef36001a02aa7362368e8a3f1127c03751166
SwiftLint: 3fe909719babe5537c552ee8181c0031392be933
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c

Expand Down
4 changes: 2 additions & 2 deletions SmileID.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = 'SmileID'
s.version = '10.2.16'
s.version = '10.2.17'
s.summary = 'The Official Smile Identity iOS SDK.'
s.homepage = 'https://docs.usesmileid.com/integration-options/mobile/ios-v10-beta'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Japhet' => '[email protected]', 'Juma Allan' => '[email protected]', 'Vansh Gandhi' => '[email protected]'}
s.source = { :git => "https://github.com/smileidentity/ios.git", :tag => "v10.2.16" }
s.source = { :git => "https://github.com/smileidentity/ios.git", :tag => "v10.2.17" }
s.ios.deployment_target = '13.0'
s.dependency 'ZIPFoundation', '~> 0.9'
s.dependency 'FingerprintJS'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@ enum DocumentCaptureFlow: Equatable {
case processing(ProcessingState)
}

internal class IOrchestratedDocumentVerificationViewModel<T, U: JobResult>: ObservableObject {
class IOrchestratedDocumentVerificationViewModel<T, U: JobResult>: ObservableObject {
// Input properties
internal let userId: String
internal let jobId: String
internal let allowNewEnroll: Bool
internal let countryCode: String
internal let documentType: String?
internal let captureBothSides: Bool
internal let jobType: JobType
internal let extraPartnerParams: [String: String]
let userId: String
let jobId: String
let allowNewEnroll: Bool
let countryCode: String
let documentType: String?
let captureBothSides: Bool
let skipApiSubmission: Bool
let jobType: JobType
let extraPartnerParams: [String: String]

// Other properties
internal var documentFrontFile: Data?
internal var documentBackFile: Data?
internal var selfieFile: URL?
internal var livenessFiles: [URL]?
internal var savedFiles: DocumentCaptureResultStore?
internal var stepToRetry: DocumentCaptureFlow?
internal var didSubmitJob: Bool = false
internal var error: Error?
var documentFrontFile: Data?
var documentBackFile: Data?
var selfieFile: URL?
var livenessFiles: [URL]?
var savedFiles: DocumentCaptureResultStore?
var stepToRetry: DocumentCaptureFlow?
var didSubmitJob: Bool = false
var error: Error?
var localMetadata: LocalMetadata

// UI properties
Expand All @@ -39,13 +40,14 @@ internal class IOrchestratedDocumentVerificationViewModel<T, U: JobResult>: Obse
@Published var errorMessage: String?
@Published var step = DocumentCaptureFlow.frontDocumentCapture

internal init(
init(
userId: String,
jobId: String,
allowNewEnroll: Bool,
countryCode: String,
documentType: String?,
captureBothSides: Bool,
skipApiSubmission: Bool,
selfieFile: URL?,
jobType: JobType,
extraPartnerParams: [String: String] = [:],
Expand All @@ -57,6 +59,7 @@ internal class IOrchestratedDocumentVerificationViewModel<T, U: JobResult>: Obse
self.countryCode = countryCode
self.documentType = documentType
self.captureBothSides = captureBothSides
self.skipApiSubmission = skipApiSubmission
self.selfieFile = selfieFile
self.jobType = jobType
self.extraPartnerParams = extraPartnerParams
Expand Down Expand Up @@ -177,6 +180,10 @@ internal class IOrchestratedDocumentVerificationViewModel<T, U: JobResult>: Obse
selfie: selfieFile,
livenessImages: livenessFiles ?? []
)
if skipApiSubmission {
DispatchQueue.main.async { self.step = .processing(.success) }
return
}
let authRequest = AuthenticationRequest(
jobType: jobType,
enrollment: false,
Expand All @@ -197,7 +204,7 @@ internal class IOrchestratedDocumentVerificationViewModel<T, U: JobResult>: Obse
let authResponse = try await SmileID.api.authenticate(request: authRequest)
let prepUploadRequest = PrepUploadRequest(
partnerParams: authResponse.partnerParams.copy(extras: self.extraPartnerParams),
allowNewEnroll: String(allowNewEnroll), // TODO: - Fix when Michael changes this to boolean
allowNewEnroll: String(allowNewEnroll), // TODO: - Fix when Michael changes this to boolean
metadata: localMetadata.metadata.items,
timestamp: authResponse.timestamp,
signature: authResponse.signature
Expand Down Expand Up @@ -321,14 +328,14 @@ extension IOrchestratedDocumentVerificationViewModel: SmartSelfieResultDelegate
}

// swiftlint:disable opening_brace
internal class OrchestratedDocumentVerificationViewModel:
class OrchestratedDocumentVerificationViewModel:
IOrchestratedDocumentVerificationViewModel<DocumentVerificationResultDelegate, DocumentVerificationJobResult>
{
override func onFinished(delegate: DocumentVerificationResultDelegate) {
if let savedFiles,
let selfiePath = getRelativePath(from: selfieFile),
let documentFrontPath = getRelativePath(from: savedFiles.documentFront),
let documentBackPath = getRelativePath(from: savedFiles.documentBack)
let selfiePath = getRelativePath(from: selfieFile),
let documentFrontPath = getRelativePath(from: savedFiles.documentFront),
let documentBackPath = getRelativePath(from: savedFiles.documentBack)
{
delegate.didSucceed(
selfie: selfiePath,
Expand All @@ -347,16 +354,16 @@ internal class OrchestratedDocumentVerificationViewModel:
}

// swiftlint:disable opening_brace
internal class OrchestratedEnhancedDocumentVerificationViewModel:
class OrchestratedEnhancedDocumentVerificationViewModel:
IOrchestratedDocumentVerificationViewModel<
EnhancedDocumentVerificationResultDelegate, EnhancedDocumentVerificationJobResult
>
{
override func onFinished(delegate: EnhancedDocumentVerificationResultDelegate) {
if let savedFiles,
let selfiePath = getRelativePath(from: selfieFile),
let documentFrontPath = getRelativePath(from: savedFiles.documentFront),
let documentBackPath = getRelativePath(from: savedFiles.documentBack)
let selfiePath = getRelativePath(from: selfieFile),
let documentFrontPath = getRelativePath(from: savedFiles.documentFront),
let documentBackPath = getRelativePath(from: savedFiles.documentBack)
{
delegate.didSucceed(
selfie: selfiePath,
Expand Down
Loading
Loading