-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add lottie animation, product cells for selfie enrollment and selfie …
…authentication with strict mode.
- Loading branch information
Showing
6 changed files
with
237 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
Sources/SmileID/Classes/SelfieCapture/SelfieViewModelV2.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Foundation | ||
|
||
public class SelfieViewModelV2: ObservableObject { | ||
@Published var processingState: ProcessingState? | ||
|
||
let useStrictMode: Bool | ||
|
||
var cameraManager = CameraManager(orientation: .portrait) | ||
|
||
init( | ||
useStrictMode: Bool = false | ||
) { | ||
self.useStrictMode = useStrictMode | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Sources/SmileID/Classes/SelfieCapture/View/OrchestratedSelfieCaptureScreenV2.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Foundation | ||
import SwiftUI | ||
|
||
/// Orchestrates the selfie capture flow - navigates between instructions, requesting permissions, | ||
/// showing camera view, and displaying processing screen | ||
public struct OrchestratedSelfieCaptureScreenV2: View { | ||
public let allowAgentMode: Bool | ||
public let showAttribution: Bool | ||
public let showInstructions: Bool | ||
public let onResult: SmartSelfieResultDelegate | ||
@ObservedObject var viewModel: SelfieViewModelV2 | ||
|
||
@State private var acknowledgedInstructions = false | ||
private var originalBrightness = UIScreen.main.brightness | ||
|
||
public init( | ||
userId: String, | ||
jobId: String, | ||
isEnroll: Bool, | ||
allowNewEnroll: Bool, | ||
allowAgentMode: Bool, | ||
showAttribution: Bool, | ||
showInstructions: Bool, | ||
useStrictMode: Bool, | ||
extraPartnerParams: [String: String], | ||
skipApiSubmission: Bool, | ||
onResult: SmartSelfieResultDelegate | ||
) { | ||
self.allowAgentMode = allowAgentMode | ||
self.showAttribution = showAttribution | ||
self.showInstructions = showInstructions | ||
self.onResult = onResult | ||
viewModel = SelfieViewModelV2() | ||
} | ||
|
||
public var body: some View { | ||
if showInstructions, !acknowledgedInstructions { | ||
SmartSelfieInstructionsScreen(showAttribution: showAttribution) { | ||
acknowledgedInstructions = true | ||
} | ||
} else { | ||
SelfieCaptureScreenV2() | ||
} | ||
} | ||
} |
91 changes: 80 additions & 11 deletions
91
Sources/SmileID/Classes/SelfieCapture/View/SelfieCaptureScreenV2.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters