Skip to content

Commit

Permalink
feat: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
JNdhlovu committed Aug 21, 2024
2 parents a5bd4ca + 57b0a97 commit 5c30124
Show file tree
Hide file tree
Showing 40 changed files with 1,790 additions and 613 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# Release Notes

## 10.2.7

### Changed
* Replaced the Zip library to introduce in memory ziping during file upload
* Remove `prodUrl` and `testURl` from Config model struct since the `prod_url` and `test_url` keys are no longer used in the `smile_config.json` file.
* Disabled dark mode as we fix theming across the sdk
* Fixed ambigious file paths on responses

## 10.2.6

### Changed
* Removed `SmileID.setEnvironment()` since the API Keys are no longer shared between environments
* All polling methods now return a `AsyncThrowingStream<JobStatusResponse<T>, Error>` and instead of a timeout, if there is no error it'll return the last valid response and complete the stream.
* Fixed a bug where prep upload would not work for previously attempted API requests


## 10.2.5

#### Fixed
Expand Down
20 changes: 10 additions & 10 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ PODS:
- ArkanaKeysInterfaces (1.0.0)
- lottie-ios (4.4.3)
- netfox (1.21.0)
- Sentry (8.31.1):
- Sentry/Core (= 8.31.1)
- Sentry/Core (8.31.1)
- SmileID (10.2.5):
- Sentry (8.32.0):
- Sentry/Core (= 8.32.0)
- Sentry/Core (8.32.0)
- SmileID (10.2.7):
- lottie-ios (~> 4.4.2)
- Zip (~> 2.1.0)
- ZIPFoundation (~> 0.9)
- SwiftLint (0.55.1)
- Zip (2.1.2)
- ZIPFoundation (0.9.19)

DEPENDENCIES:
- ArkanaKeys (from `./ArkanaKeys/ArkanaKeys/`)
Expand All @@ -27,7 +27,7 @@ SPEC REPOS:
- netfox
- Sentry
- SwiftLint
- Zip
- ZIPFoundation

EXTERNAL SOURCES:
ArkanaKeys:
Expand All @@ -42,10 +42,10 @@ SPEC CHECKSUMS:
ArkanaKeysInterfaces: 81d21923368b058e2b6fd932ec96855166ef6d19
lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418
netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7
Sentry: 9c1188876ea1291d1a9db4b38c3f17ebd8e6985e
SmileID: 09d42fdc65cd4d2b0d33fd33e14e8c85a189a64b
Sentry: 96ae1dcdf01a644bc3a3b1dc279cecaf48a833fb
SmileID: 500429946fbb916221450c9f792fa94ee1060955
SwiftLint: 3fe909719babe5537c552ee8181c0031392be933
Zip: b3fef584b147b6e582b2256a9815c897d60ddc67
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c

PODFILE CHECKSUM: ebb96bfc1b5a0c7f6061ff1e91ac138e67c1d9f4

Expand Down
12 changes: 6 additions & 6 deletions Example/SmileID.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 /* (null) in Sources */ = {isa = PBXBuildFile; };
20F3D6F32C25F4D700B32751 /* BuildFile 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 */; };
Expand All @@ -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 /* (null) in Resources */ = {isa = PBXBuildFile; };
620F1E9A2B691ABB00185CD2 /* BuildFile 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 */; };
Expand Down Expand Up @@ -546,7 +546,7 @@
buildActionMask = 2147483647;
files = (
1EFAB3172A375265008E3C13 /* Images.xcassets in Resources */,
620F1E9A2B691ABB00185CD2 /* (null) in Resources */,
620F1E9A2B691ABB00185CD2 /* BuildFile in Resources */,
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
5829A8C02BC7429A001C1E7E /* PrivacyInfo.xcprivacy in Resources */,
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
Expand All @@ -572,7 +572,7 @@
"${PODS_ROOT}/Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Sentry/Sentry.framework",
"${BUILT_PRODUCTS_DIR}/SmileID/SmileID.framework",
"${BUILT_PRODUCTS_DIR}/Zip/Zip.framework",
"${BUILT_PRODUCTS_DIR}/ZIPFoundation/ZIPFoundation.framework",
"${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework",
"${BUILT_PRODUCTS_DIR}/netfox/netfox.framework",
"${BUILT_PRODUCTS_DIR}/ArkanaKeys/ArkanaKeys.framework",
Expand All @@ -582,7 +582,7 @@
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sentry.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SmileID.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Zip.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZIPFoundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/netfox.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ArkanaKeys.framework",
Expand Down Expand Up @@ -693,7 +693,7 @@
1ED53F6D2A2F28590020BEFB /* SmileTextField.swift in Sources */,
91CB21A52AC10C61005AEBF5 /* NavigationBar.swift in Sources */,
1ED53F6B2A2F28590020BEFB /* ProductCell.swift in Sources */,
20F3D6F32C25F4D700B32751 /* (null) in Sources */,
20F3D6F32C25F4D700B32751 /* BuildFile in Sources */,
1E60ED382A29C306002695FF /* Constants.swift in Sources */,
624777D02B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift in Sources */,
1ED53F712A2F28590020BEFB /* EnterUserIDView.swift in Sources */,
Expand Down
5 changes: 4 additions & 1 deletion Example/SmileID/App/RootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ struct RootView: View {
.ignoresSafeArea()
.preferredColorScheme(.light)
} else {
WelcomeScreen(showSuccess: $showSuccess)
WelcomeScreen(
showSuccess: $showSuccess,
didUpdateConfig: { viewModel.updateConfig(config: $0) }
)
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions Example/SmileID/Components/SmileEnvironmentToggleButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import SwiftUI
import SmileID

struct SmileEnvironmentToggleButton: View {
@State private var isProduction: Bool = true
@State private var isProduction: Bool = !SmileID.useSandbox

var body: some View {
Button(
action: {
isProduction.toggle()
SmileID.setEnvironment(useSandbox: !isProduction)
},
action: {},
label: {
Text(isProduction ? "Production" : "Sandbox")
.font(SmileID.theme.button)
Expand Down
4 changes: 0 additions & 4 deletions Example/SmileID/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ private struct HomeView_Previews: PreviewProvider {
config: Config(
partnerId: "",
authToken: "",
prodUrl: "",
testUrl: "",
prodLambdaUrl: "",
testLambdaUrl: ""
),
Expand All @@ -300,8 +298,6 @@ private struct HomeView_Previews: PreviewProvider {
HomeView(config: Config(
partnerId: "1000",
authToken: "",
prodUrl: "",
testUrl: "",
prodLambdaUrl: "",
testLambdaUrl: ""
))
Expand Down
2 changes: 0 additions & 2 deletions Example/SmileID/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ class HomeViewController: UIViewController, SmartSelfieResultDelegate {

@IBAction func onEnvironmentToggle(_ sender: UIBarButtonItem) {
if sender.title!.lowercased() == "sandbox" {
SmileID.setEnvironment(useSandbox: false)
sender.title = "Production"
} else {
SmileID.setEnvironment(useSandbox: true)
sender.title = "Sandbox"
}
}
Expand Down
16 changes: 8 additions & 8 deletions Example/SmileID/Jobs/JobItemModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class JobItemModel: ObservableObject {
interval: 1,
numAttempts: 30
)
var response : JobStatusResponse<JobResult>? = nil
var response: JobStatusResponse<JobResult>? = nil

for try await res in pollStream {
response = res
}
Expand All @@ -67,18 +67,18 @@ class JobItemModel: ObservableObject {
isLoading = true
defer { isLoading = false }
task = Task {
return try await getJobStatus()
try await getJobStatus()
}
guard let task = self.task else { return }
guard let task = task else { return }
let jobStatusResponse = try await task.value
if let updatedJob = try dataStoreClient.updateJob(data: jobStatusResponse) {
self.job = updatedJob
job = updatedJob
}
}

func cancelTask() {
self.isLoading = false
self.task?.cancel()
self.task = nil
isLoading = false
task?.cancel()
task = nil
}
}
2 changes: 0 additions & 2 deletions Example/SmileID/Jobs/JobsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ struct JobsView: View {
config: Config(
partnerId: "1000",
authToken: "",
prodUrl: "",
testUrl: "",
prodLambdaUrl: "",
testLambdaUrl: ""
)
Expand Down
22 changes: 12 additions & 10 deletions Example/SmileID/WelcomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ struct WelcomeScreen: View {
@State private var showQrCodeScanner = false
@State private var errorMessage: String?
@Binding var showSuccess: Bool
@State private var partnerId: String?
@State private var config: Config?
var didUpdateConfig: (Config) -> Void

var body: some View {
VStack(alignment: .leading) {
Expand All @@ -26,7 +27,7 @@ struct WelcomeScreen: View {
.font(EpilogueFont.regular(with: 16))
.foregroundColor(SmileID.theme.onLight)
.padding(.vertical)

Link(
"https://portal.usesmileid.com/sdk",
destination: URL(string: "https://portal.usesmileid.com/sdk")!
Expand Down Expand Up @@ -82,8 +83,8 @@ struct WelcomeScreen: View {
.sheet(isPresented: $showManualEntrySheet) {
let content = SmileConfigEntryView(errorMessage: errorMessage) { smileConfig in
let response = updateSmileConfig(smileConfig)
if let smilePartnerId = response {
partnerId = smilePartnerId
if let config = response {
self.config = config
showSuccess = true
showManualEntrySheet = false
} else {
Expand All @@ -107,8 +108,8 @@ struct WelcomeScreen: View {
if case let .success(result) = response {
let configJson = result.string
let response = updateSmileConfig(configJson)
if let smilePartnerId = response {
partnerId = smilePartnerId
if let config = response {
self.config = config
showSuccess = true
showQrCodeScanner = false
}
Expand All @@ -117,18 +118,19 @@ struct WelcomeScreen: View {
}
.overlay(
Group {
if showSuccess {
if let config, showSuccess {
Color.black.opacity(0.3)
.edgesIgnoringSafeArea(.all)
.overlay(
AlertView(
icon: Image(systemName: "checkmark.circle.fill"),
title: "Configuration Added",
description: "Welcome Partner \(partnerId ?? ""), you can "
description: "Welcome Partner \(config.partnerId), you can "
+ "now proceed to the home screen of the Sample App",
buttonTitle: "Continue",
onClick: {
showSuccess = false
didUpdateConfig(config)
}
)
.padding([.leading, .trailing], 20)
Expand All @@ -139,11 +141,11 @@ struct WelcomeScreen: View {
}
}

private func updateSmileConfig(_ configJson: String) -> String? {
private func updateSmileConfig(_ configJson: String) -> Config? {
do {
let config = try JSONDecoder().decode(Config.self, from: configJson.data(using: .utf8)!)
UserDefaults.standard.set(configJson, forKey: "smileConfig")
return config.partnerId
return config
} catch {
print("Error decoding new config: \(error)")
return nil
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ gem "fastlane"
gem "xcodeproj"
gem "arkana"
gem 'cocoapods', '~> 1.11.0'
gem "rake", "~> 13.0.0"
gem "rake", "~> 13.0.0"
14 changes: 7 additions & 7 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
{
"identity" : "lottie-spm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-spm.git",
"location" : "https://github.com/airbnb/lottie-spm",
"state" : {
"revision" : "1d29eccc24cc8b75bff9f6804155112c0ffc9605",
"version" : "4.4.3"
"revision" : "b842598f1295f3ffa1475b1580672d1fe5b83580",
"version" : "4.5.0"
}
},
{
"identity" : "zip",
"identity" : "zipfoundation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marmelroy/Zip",
"location" : "https://github.com/weichsel/ZIPFoundation.git",
"state" : {
"revision" : "67fa55813b9e7b3b9acee9c0ae501def28746d76",
"version" : "2.1.2"
"revision" : "02b6abe5f6eef7e3cbd5f247c5cc24e246efcfe0",
"version" : "0.9.19"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/marmelroy/Zip", .upToNextMajor(from: "2.1.0")),
.package(url: "https://github.com/weichsel/ZIPFoundation.git", .upToNextMajor(from: "0.9.0")),
.package(url: "https://github.com/airbnb/lottie-spm", from: "4.4.2")
],
targets: [
.target(
name: "SmileID",
dependencies: ["Zip", .product(name: "Lottie", package: "lottie-spm")],
dependencies: ["ZIPFoundation", .product(name: "Lottie", package: "lottie-spm")],
path: "Sources/SmileID",
resources: [.process("Resources")]
),
Expand Down
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace :build do
sh 'mv SmileID.zip SmileID.sha256 release/'
end
end

namespace :test do
desc 'Tests the package , processed the test results and tests spm compatibility'
task all: ['package', 'process', 'spm','example']
Expand All @@ -62,7 +62,7 @@ namespace :test do
xcodebuild('build -scheme "SmileID" -destination generic/platform=iOS',"SmileID.xcodeproj")
end
end

namespace :lint do
desc 'Lints swift files'
task :swift do
Expand All @@ -74,14 +74,14 @@ namespace :lint do
sh 'pod lib lint SmileID.podspec'
end
end

namespace :format do
desc 'Formats swift files'
task :swift do
sh 'mint run swiftformat . --swiftversion 5.8'
end
end

def xcodebuild(command, project = "Example/SmileID.xcworkspace")
# Determine the project flag based on the file extension
project_flag = if project.end_with?(".xcworkspace")
Expand Down Expand Up @@ -124,4 +124,4 @@ def xcarchive(command)
else
sh "xcodebuild #{command}"
end
end
end
Loading

0 comments on commit 5c30124

Please sign in to comment.