diff --git a/Example/SmileID.xcodeproj/project.pbxproj b/Example/SmileID.xcodeproj/project.pbxproj index 01757d569..8f4c6dec4 100644 --- a/Example/SmileID.xcodeproj/project.pbxproj +++ b/Example/SmileID.xcodeproj/project.pbxproj @@ -39,7 +39,7 @@ 20B6D5EC2C21CE660023D51C /* DataStoreError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20B6D5EB2C21CE660023D51C /* DataStoreError.swift */; }; 20C360C82C454C130008DBDE /* RootViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20C360C72C454C130008DBDE /* RootViewModel.swift */; }; 20DFA0EC2C21917100AC2AE7 /* View+TextSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20DFA0EB2C21917100AC2AE7 /* View+TextSelection.swift */; }; - 20F3D6F32C25F4D700B32751 /* BuildFile in Sources */ = {isa = PBXBuildFile; }; + 20F3D6F32C25F4D700B32751 /* (null) in Sources */ = {isa = PBXBuildFile; }; 20F3D6F62C25F5C100B32751 /* SmileID.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 20F3D6F42C25F5C100B32751 /* SmileID.xcdatamodeld */; }; 5829A8C02BC7429A001C1E7E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 5829A8BF2BC7429A001C1E7E /* PrivacyInfo.xcprivacy */; }; 585BE4882AC7748E0091DDD8 /* RestartableTimerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 585BE4872AC7748E0091DDD8 /* RestartableTimerTest.swift */; }; @@ -48,7 +48,7 @@ 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 620F1E982B69194900185CD2 /* AlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 620F1E972B69194900185CD2 /* AlertView.swift */; }; - 620F1E9A2B691ABB00185CD2 /* BuildFile in Resources */ = {isa = PBXBuildFile; }; + 620F1E9A2B691ABB00185CD2 /* (null) in Resources */ = {isa = PBXBuildFile; }; 624777D02B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 624777CF2B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift */; }; 62F6766F2B0D173600417419 /* EnhancedKycWithIdInputScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F6766E2B0D173600417419 /* EnhancedKycWithIdInputScreenViewModel.swift */; }; 62F676712B0E00E800417419 /* EnhancedKycResultDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F676702B0E00E800417419 /* EnhancedKycResultDelegate.swift */; }; @@ -549,7 +549,7 @@ buildActionMask = 2147483647; files = ( 1EFAB3172A375265008E3C13 /* Images.xcassets in Resources */, - 620F1E9A2B691ABB00185CD2 /* BuildFile in Resources */, + 620F1E9A2B691ABB00185CD2 /* (null) in Resources */, 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 5829A8C02BC7429A001C1E7E /* PrivacyInfo.xcprivacy in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, @@ -698,7 +698,7 @@ 1ED53F6D2A2F28590020BEFB /* SmileTextField.swift in Sources */, 91CB21A52AC10C61005AEBF5 /* NavigationBar.swift in Sources */, 1ED53F6B2A2F28590020BEFB /* ProductCell.swift in Sources */, - 20F3D6F32C25F4D700B32751 /* BuildFile in Sources */, + 20F3D6F32C25F4D700B32751 /* (null) in Sources */, 1E60ED382A29C306002695FF /* Constants.swift in Sources */, 624777D02B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift in Sources */, 1ED53F712A2F28590020BEFB /* EnterUserIDView.swift in Sources */, @@ -891,7 +891,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 39; + CURRENT_PROJECT_VERSION = 40; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99P7YGX9Q6; @@ -924,7 +924,7 @@ CODE_SIGN_IDENTITY = "Apple Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 39; + CURRENT_PROJECT_VERSION = 40; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99P7YGX9Q6; diff --git a/Example/SmileID/BiometricKYC/BiometricKycWithIdInputScreen.swift b/Example/SmileID/BiometricKYC/BiometricKycWithIdInputScreen.swift index 2e52e4892..ecdf4ab24 100644 --- a/Example/SmileID/BiometricKYC/BiometricKycWithIdInputScreen.swift +++ b/Example/SmileID/BiometricKYC/BiometricKycWithIdInputScreen.swift @@ -6,7 +6,7 @@ struct BiometricKycWithIdInputScreen: View { let delegate: BiometricKycResultDelegate @State private var selectedCountry: CountryInfo? - @ObservedObject var viewModel: BiometricKycWithIdInputScreenViewModel + @StateObject var viewModel: BiometricKycWithIdInputScreenViewModel var body: some View { switch viewModel.step { @@ -19,25 +19,27 @@ struct BiometricKycWithIdInputScreen: View { } .frame(maxWidth: .infinity) case .idTypeSelection(let countryList): - SearchableDropdownSelector( - items: countryList, - selectedItem: selectedCountry, - itemDisplayName: { $0.name }, - onItemSelected: { selectedCountry = $0 } - ) - if let selectedCountry = selectedCountry { - RadioGroupSelector( - title: "Select ID Type", - items: selectedCountry.availableIdTypes, - itemDisplayName: { $0.label }, - onItemSelected: { idType in - viewModel.onIdTypeSelected( - country: selectedCountry.countryCode, - idType: idType.idTypeKey, - requiredFields: idType.requiredFields ?? [] - ) - } + VStack { + SearchableDropdownSelector( + items: countryList, + selectedItem: selectedCountry, + itemDisplayName: { $0.name }, + onItemSelected: { selectedCountry = $0 } ) + if let selectedCountry = selectedCountry { + RadioGroupSelector( + title: "Select ID Type", + items: selectedCountry.availableIdTypes, + itemDisplayName: { $0.label }, + onItemSelected: { idType in + viewModel.onIdTypeSelected( + country: selectedCountry.countryCode, + idType: idType.idTypeKey, + requiredFields: idType.requiredFields ?? [] + ) + } + ) + } } case .consent(let country, let idType, let requiredFields): SmileID.consentScreen( diff --git a/Example/SmileID/EnhancedKYC/EnhancedKycWithIdInputScreen.swift b/Example/SmileID/EnhancedKYC/EnhancedKycWithIdInputScreen.swift index b72daadfc..c0f1ff2db 100644 --- a/Example/SmileID/EnhancedKYC/EnhancedKycWithIdInputScreen.swift +++ b/Example/SmileID/EnhancedKYC/EnhancedKycWithIdInputScreen.swift @@ -18,25 +18,27 @@ struct EnhancedKycWithIdInputScreen: View { } .frame(maxWidth: .infinity) case .idTypeSelection(let countryList): - SearchableDropdownSelector( - items: countryList, - selectedItem: selectedCountry, - itemDisplayName: { $0.name }, - onItemSelected: { selectedCountry = $0 } - ) - if let selectedCountry = selectedCountry { - RadioGroupSelector( - title: "Select ID Type", - items: selectedCountry.availableIdTypes, - itemDisplayName: { $0.label }, - onItemSelected: { idType in - viewModel.onIdTypeSelected( - country: selectedCountry.countryCode, - idType: idType.idTypeKey, - requiredFields: idType.requiredFields ?? [] - ) - } + VStack { + SearchableDropdownSelector( + items: countryList, + selectedItem: selectedCountry, + itemDisplayName: { $0.name }, + onItemSelected: { selectedCountry = $0 } ) + if let selectedCountry = selectedCountry { + RadioGroupSelector( + title: "Select ID Type", + items: selectedCountry.availableIdTypes, + itemDisplayName: { $0.label }, + onItemSelected: { idType in + viewModel.onIdTypeSelected( + country: selectedCountry.countryCode, + idType: idType.idTypeKey, + requiredFields: idType.requiredFields ?? [] + ) + } + ) + } } case .consent(let country, let idType, let requiredFields): SmileID.consentScreen( diff --git a/Example/SmileID/Home/HomeView.swift b/Example/SmileID/Home/HomeView.swift index 86cc62d57..086b7fb42 100644 --- a/Example/SmileID/Home/HomeView.swift +++ b/Example/SmileID/Home/HomeView.swift @@ -28,11 +28,11 @@ struct HomeView: View { }, content: { SmileID.smartSelfieEnrollmentScreen( - userId: viewModel.smartSelfieEnrollmentUserId, + userId: viewModel.newUserId, jobId: viewModel.newJobId, allowAgentMode: true, delegate: SmartSelfieEnrollmentDelegate( - userId: viewModel.smartSelfieEnrollmentUserId, + userId: viewModel.newUserId, onEnrollmentSuccess: viewModel.onSmartSelfieEnrollment, onError: viewModel.didError ) @@ -47,7 +47,7 @@ struct HomeView: View { }, content: { SmartSelfieAuthWithUserIdEntry( - initialUserId: viewModel.smartSelfieEnrollmentUserId, + initialUserId: viewModel.lastSelfieEnrollmentUserId ?? "", delegate: viewModel ) } @@ -60,12 +60,12 @@ struct HomeView: View { }, content: { SmileID.smartSelfieEnrollmentScreen( - userId: viewModel.smartSelfieEnrollmentUserId, + userId: viewModel.newUserId, jobId: viewModel.newJobId, allowAgentMode: true, useStrictMode: true, delegate: SmartSelfieEnrollmentDelegate( - userId: viewModel.smartSelfieEnrollmentUserId, + userId: viewModel.newUserId, onEnrollmentSuccess: viewModel.onSmartSelfieEnrollment, onError: viewModel.didError ) @@ -80,7 +80,7 @@ struct HomeView: View { }, content: { SmartSelfieAuthWithUserIdEntry( - initialUserId: viewModel.smartSelfieEnrollmentUserId, + initialUserId: viewModel.lastSelfieEnrollmentUserId ?? "", useStrictMode: true, delegate: viewModel ) diff --git a/Example/SmileID/Home/HomeViewModel.swift b/Example/SmileID/Home/HomeViewModel.swift index 709b464cf..6828faf80 100644 --- a/Example/SmileID/Home/HomeViewModel.swift +++ b/Example/SmileID/Home/HomeViewModel.swift @@ -19,7 +19,10 @@ class HomeViewModel: ObservableObject, @Published var partnerId: String var networkMonitor = NetworkMonitor.shared - @Published private(set) var smartSelfieEnrollmentUserId = generateUserId() + var lastSelfieEnrollmentUserId: String? { + guard let value = UIPasteboard.general.string else { return nil } + return value.hasPrefix("user-") ? value : nil + } @Published private(set) var newUserId: String = generateUserId() @Published private(set) var newJobId: String = generateJobId() diff --git a/Example/SmileID/Info.plist b/Example/SmileID/Info.plist index 09bc02c40..b42aec4ca 100644 --- a/Example/SmileID/Info.plist +++ b/Example/SmileID/Info.plist @@ -2,6 +2,8 @@ + ITSAppUsesNonExemptEncryption + CFBundleDevelopmentRegion en CFBundleExecutable diff --git a/Sources/SmileID/Classes/Consent/OrchestratedConsentScreen.swift b/Sources/SmileID/Classes/Consent/OrchestratedConsentScreen.swift index 9224c27d9..430276f79 100644 --- a/Sources/SmileID/Classes/Consent/OrchestratedConsentScreen.swift +++ b/Sources/SmileID/Classes/Consent/OrchestratedConsentScreen.swift @@ -74,7 +74,7 @@ public struct ConsentScreen: View { .padding(16) VStack(spacing: 16) { - ForEach(0..: View { Spacer() Text(itemDisplayName(selectedItem)) .foregroundColor(SmileID.theme.accent) - .onTapGesture { onItemSelected(nil) } Spacer() Image(systemName: "arrowtriangle.down.circle.fill") .foregroundColor(SmileID.theme.accent) } + .contentShape(.rect) + .onTapGesture { onItemSelected(nil) } } else { ZStack(alignment: .leading) { Image(systemName: "magnifyingglass")