diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a9013..93f0703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 4.8.0 +- Added ability for manual delete exposure risk info + ## 4.7.1 - Bump iOS version availability for some log methods - Clear exposure risk info on demand @@ -51,37 +54,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Removed device check from uploaded payloads ## 4.2.4 - - Changed telephone number and email - Changed text copy on an onboarding view - Removed some tips - Added properties ENDeveloperRegion and ENAPIVersion to Info.plist for iOS 14 ## 4.2.3 - - Passing app version to PWA - Updated certificates for pinning - Updated Privacy Policy URL in appstore -## 4.2.2s - +## 4.2.2 - Fix for disabling of screen recording - Replaced all fatalError and assertionFailure due to storing full user paths in binary file ## 4.2.1 - - Manage large Diagnosis Keys batches - Refactored keys upload process - Bug fixes ## 4.2.0 - - Removed online PWA - Added PWA as a part of app code (offline) - Bug fixes ## 4.1.1 - - Added Exposure Notification API - Added Background Download Task For Exposure Notification - Added Support For Exposure Notification Incompatible Devices @@ -94,7 +91,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## 3.0.2 - - Manage project settings with yml config files - XcodeGen added - Debug console added for Stage and Dev configs - Moved anonymous signIn to Firebase on app start @@ -107,10 +103,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## 3.0.1 - - Added OpenTrace module for collecting BLE contacts ## 2.0.1 - - Basic version with PWA, and notifications diff --git a/Podfile b/Podfile index 112e929..60fefb8 100644 --- a/Podfile +++ b/Podfile @@ -13,10 +13,10 @@ def pods_definition pod 'PromiseKit', '~> 6.8' pod 'Moya', '~> 14.0' pod 'ZIPFoundation', '~> 0.9' - pod 'RealmSwift', '~> 5.0.0' pod 'KeychainAccess', '~> 4.2.0' pod 'TrustKit', '~> 1.6.5' pod 'Siren', '~> 5.4.0' + pod 'RealmSwift', '~> 5.0.0' pod 'DBDebugToolkit', :configurations => ['Dev', 'DevDist', 'Stage', 'StageDebug', 'StageScreencast', 'LiveDebug', 'LiveAdhoc'] diff --git a/Podfile.lock b/Podfile.lock index 3332a66..b19f076 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,106 +1,92 @@ PODS: - - Alamofire (5.2.0) - - DBDebugToolkit (0.5.0) - - Firebase/Auth (6.26.0): + - Alamofire (5.4.0) + - DBDebugToolkit (0.6.0) + - Firebase/Auth (7.0.0): - Firebase/CoreOnly - - FirebaseAuth (~> 6.5.3) - - Firebase/CoreOnly (6.26.0): - - FirebaseCore (= 6.7.2) - - Firebase/Functions (6.26.0): + - FirebaseAuth (~> 7.0.0) + - Firebase/CoreOnly (7.0.0): + - FirebaseCore (= 7.0.0) + - Firebase/Functions (7.0.0): - Firebase/CoreOnly - - FirebaseFunctions (~> 2.5.1) - - Firebase/Messaging (6.26.0): + - FirebaseFunctions (~> 7.0.0) + - Firebase/Messaging (7.0.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 4.4.1) - - Firebase/RemoteConfig (6.26.0): + - FirebaseMessaging (~> 7.0.0) + - Firebase/RemoteConfig (7.0.0): - Firebase/CoreOnly - - FirebaseRemoteConfig (~> 4.5.0) - - FirebaseABTesting (3.2.0): - - FirebaseAnalyticsInterop (~> 1.3) - - FirebaseCore (~> 6.1) - - Protobuf (>= 3.9.2, ~> 3.9) - - FirebaseAnalyticsInterop (1.5.0) - - FirebaseAuth (6.5.3): - - FirebaseAuthInterop (~> 1.0) - - FirebaseCore (~> 6.6) - - GoogleUtilities/AppDelegateSwizzler (~> 6.5) - - GoogleUtilities/Environment (~> 6.5) - - GTMSessionFetcher/Core (~> 1.1) - - FirebaseAuthInterop (1.1.0) - - FirebaseCore (6.7.2): - - FirebaseCoreDiagnostics (~> 1.3) - - FirebaseCoreDiagnosticsInterop (~> 1.2) - - GoogleUtilities/Environment (~> 6.5) - - GoogleUtilities/Logger (~> 6.5) - - FirebaseCoreDiagnostics (1.3.0): - - FirebaseCoreDiagnosticsInterop (~> 1.2) - - GoogleDataTransportCCTSupport (~> 3.1) - - GoogleUtilities/Environment (~> 6.5) - - GoogleUtilities/Logger (~> 6.5) - - nanopb (~> 1.30905.0) - - FirebaseCoreDiagnosticsInterop (1.2.0) - - FirebaseFunctions (2.5.1): - - FirebaseAuthInterop (~> 1.0) - - FirebaseCore (~> 6.0) - - GTMSessionFetcher/Core (~> 1.1) - - FirebaseInstallations (1.3.0): - - FirebaseCore (~> 6.6) - - GoogleUtilities/Environment (~> 6.6) - - GoogleUtilities/UserDefaults (~> 6.6) + - FirebaseRemoteConfig (~> 7.0.0) + - FirebaseABTesting (7.0.0): + - FirebaseCore (~> 7.0) + - FirebaseAuth (7.0.0): + - FirebaseCore (~> 7.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GTMSessionFetcher/Core (~> 1.4) + - FirebaseCore (7.0.0): + - FirebaseCoreDiagnostics (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - FirebaseCoreDiagnostics (7.0.0): + - GoogleDataTransport (~> 8.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - nanopb (~> 2.30906.0) + - FirebaseFunctions (7.0.0): + - FirebaseCore (~> 7.0) + - GTMSessionFetcher/Core (~> 1.4) + - FirebaseInstallations (7.0.0): + - FirebaseCore (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/UserDefaults (~> 7.0) - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.3.4): - - FirebaseCore (~> 6.6) - - FirebaseInstallations (~> 1.0) - - GoogleUtilities/Environment (~> 6.5) - - GoogleUtilities/UserDefaults (~> 6.5) - - FirebaseMessaging (4.4.1): - - FirebaseAnalyticsInterop (~> 1.5) - - FirebaseCore (~> 6.6) - - FirebaseInstanceID (~> 4.3) - - GoogleUtilities/AppDelegateSwizzler (~> 6.5) - - GoogleUtilities/Environment (~> 6.5) - - GoogleUtilities/Reachability (~> 6.5) - - GoogleUtilities/UserDefaults (~> 6.5) - - Protobuf (>= 3.9.2, ~> 3.9) - - FirebaseRemoteConfig (4.5.0): - - FirebaseABTesting (~> 3.1) - - FirebaseAnalyticsInterop (~> 1.4) - - FirebaseCore (~> 6.2) - - FirebaseInstallations (~> 1.1) - - GoogleUtilities/Environment (~> 6.2) - - "GoogleUtilities/NSData+zlib (~> 6.2)" - - GoogleDataTransport (6.2.1) - - GoogleDataTransportCCTSupport (3.1.0): - - GoogleDataTransport (~> 6.1) - - nanopb (~> 1.30905.0) - - GoogleUtilities/AppDelegateSwizzler (6.6.0): + - FirebaseInstanceID (7.0.0): + - FirebaseCore (~> 7.0) + - FirebaseInstallations (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/UserDefaults (~> 7.0) + - FirebaseMessaging (7.0.0): + - FirebaseCore (~> 7.0) + - FirebaseInstanceID (~> 7.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Reachability (~> 7.0) + - GoogleUtilities/UserDefaults (~> 7.0) + - FirebaseRemoteConfig (7.0.0): + - FirebaseABTesting (~> 7.0) + - FirebaseCore (~> 7.0) + - FirebaseInstallations (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - "GoogleUtilities/NSData+zlib (~> 7.0)" + - GoogleDataTransport (8.0.0): + - nanopb (~> 2.30906.0) + - GoogleUtilities/AppDelegateSwizzler (7.0.0): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (6.6.0): + - GoogleUtilities/Environment (7.0.0): - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.6.0): + - GoogleUtilities/Logger (7.0.0): - GoogleUtilities/Environment - - GoogleUtilities/Network (6.6.0): + - GoogleUtilities/Network (7.0.0): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.6.0)" - - GoogleUtilities/Reachability (6.6.0): + - "GoogleUtilities/NSData+zlib (7.0.0)" + - GoogleUtilities/Reachability (7.0.0): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.6.0): + - GoogleUtilities/UserDefaults (7.0.0): - GoogleUtilities/Logger - - GTMSessionFetcher/Core (1.4.0) - - KeychainAccess (4.2.0) + - GTMSessionFetcher/Core (1.5.0) + - KeychainAccess (4.2.1) - Moya (14.0.0): - Moya/Core (= 14.0.0) - Moya/Core (14.0.0): - Alamofire (~> 5.0) - - nanopb (1.30905.0): - - nanopb/decode (= 1.30905.0) - - nanopb/encode (= 1.30905.0) - - nanopb/decode (1.30905.0) - - nanopb/encode (1.30905.0) + - nanopb (2.30906.0): + - nanopb/decode (= 2.30906.0) + - nanopb/encode (= 2.30906.0) + - nanopb/decode (2.30906.0) + - nanopb/encode (2.30906.0) - PromiseKit (6.13.1): - PromiseKit/CorePromise (= 6.13.1) - PromiseKit/Foundation (= 6.13.1) @@ -110,14 +96,13 @@ PODS: - PromiseKit/CorePromise - PromiseKit/UIKit (6.13.1): - PromiseKit/CorePromise - - PromisesObjC (1.2.8) - - Protobuf (3.12.0) - - Realm (5.0.0): - - Realm/Headers (= 5.0.0) - - Realm/Headers (5.0.0) - - RealmSwift (5.0.0): - - Realm (= 5.0.0) - - Siren (5.4.0) + - PromisesObjC (1.2.11) + - Realm (5.0.3): + - Realm/Headers (= 5.0.3) + - Realm/Headers (5.0.3) + - RealmSwift (5.0.3): + - Realm (= 5.0.3) + - Siren (5.4.5) - SnapKit (5.0.1) - TrustKit (1.6.5) - ZIPFoundation (0.9.11) @@ -143,19 +128,15 @@ SPEC REPOS: - DBDebugToolkit - Firebase - FirebaseABTesting - - FirebaseAnalyticsInterop - FirebaseAuth - - FirebaseAuthInterop - FirebaseCore - FirebaseCoreDiagnostics - - FirebaseCoreDiagnosticsInterop - FirebaseFunctions - FirebaseInstallations - FirebaseInstanceID - FirebaseMessaging - FirebaseRemoteConfig - GoogleDataTransport - - GoogleDataTransportCCTSupport - GoogleUtilities - GTMSessionFetcher - KeychainAccess @@ -163,7 +144,6 @@ SPEC REPOS: - nanopb - PromiseKit - PromisesObjC - - Protobuf - Realm - RealmSwift - Siren @@ -172,38 +152,33 @@ SPEC REPOS: - ZIPFoundation SPEC CHECKSUMS: - Alamofire: c1ca147559e730bfb2182c8c7aafbdd90a867987 - DBDebugToolkit: c04bb6f618051d3de447a4b4323f37826116cfed - Firebase: 7cf5f9c67f03cb3b606d1d6535286e1080e57eb6 - FirebaseABTesting: 821a3a3e4a145987e80fee3657c4de1cb9adf693 - FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae - FirebaseAuth: 7047aec89c0b17ecd924a550c853f0c27ac6015e - FirebaseAuthInterop: a0f37ae05833af156e72028f648d313f7e7592e9 - FirebaseCore: f42e5e5f382cdcf6b617ed737bf6c871a6947b17 - FirebaseCoreDiagnostics: 4a773a47bd83bbd5a9b1ccf1ce7caa8b2d535e67 - FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850 - FirebaseFunctions: 5af7c35d1c5e41608fecbb667eb6c4e672e318d0 - FirebaseInstallations: 6f5f680e65dc374397a483c32d1799ba822a395b - FirebaseInstanceID: cef67c4967c7cecb56ea65d8acbb4834825c587b - FirebaseMessaging: 29543feb343b09546ab3aa04d008ee8595b43c44 - FirebaseRemoteConfig: 1725314c4b89d8853c876099ded037f11bee26db - GoogleDataTransport: 9a8a16f79feffc7f42096743de2a7c4815e84020 - GoogleDataTransportCCTSupport: d70a561f7d236af529fee598835caad5e25f6d3d - GoogleUtilities: 39530bc0ad980530298e9c4af8549e991fd033b1 - GTMSessionFetcher: 6f5c8abbab8a9bce4bb3f057e317728ec6182b10 - KeychainAccess: 3f760109aa99b05d0f231e28b22642da7153e38a + Alamofire: 3b6a534a3df22db367e4dedeeca73d1ddfcf0e2f + DBDebugToolkit: 03eb3483da4daf03b853b83ade5a8da9c8b7aff4 + Firebase: 50be68416f50eb4eb2ecb0e78acab9a051ef95df + FirebaseABTesting: b78ae653b7658b8f1c076eaa21029c936d58f758 + FirebaseAuth: 228dd0faa5b5263eaa8c63518b16faef438289a3 + FirebaseCore: cf3122185fce1cf71cedbbc498ea84d2b3e7cb69 + FirebaseCoreDiagnostics: 5f4aa04fdb04923693cc704c7ef9158bdf41a48b + FirebaseFunctions: 571aee227a021debe3e1092aa079f751623e233a + FirebaseInstallations: c28d4bcbb5c6884d1a39afbc0bd7fc590e31e9b7 + FirebaseInstanceID: c03b49743725092f7eb9d4b96ff40efadd830426 + FirebaseMessaging: ecf9e04716b7ff1f1d92debab4d6f0e6bdb490aa + FirebaseRemoteConfig: ff8d3542cbd919c9d3851fd544690b8848fc0402 + GoogleDataTransport: 6ce8004a961db1b905740d7be106c61ba7e89c21 + GoogleUtilities: ffb2f4159f2c897c6e8992bd7fbcdef8a300589c + GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52 + KeychainAccess: 9b07f665298d13c3a85881bd3171f6f49b8151c1 Moya: 5b45dacb75adb009f97fde91c204c1e565d31916 - nanopb: c43f40fadfe79e8b8db116583945847910cbabc9 + nanopb: 1bf24dd71191072e120b83dd02d08f3da0d65e53 PromiseKit: 28fda91c973cc377875d8c0ea4f973013c05b6db - PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6 - Protobuf: 2793fcd0622a00b546c60e7cbbcc493e043e9bb9 - Realm: 76066d333de26f97e9caedaa85ee3ff4a62ca265 - RealmSwift: c1bdff09b422569dc6881410d9ccf712bcdb79b0 - Siren: 9df16ed5278cfaad7ea034f3d2206e4f6983e9b8 + PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f + Realm: bfca1699b61b0b17c3a69ae0e648314eae91fbdb + RealmSwift: 493c9f089cd3893b3959007973c0e4f640906ba0 + Siren: 4c6f4863ea5b7f2d0e58b576663fefd8f6ef417f SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb TrustKit: 073855e3adecd317417bda4ac9e9ac54a2e3b9f2 ZIPFoundation: b1f0de4eed33e74a676f76e12559ab6b75990197 -PODFILE CHECKSUM: 3b4c80f3b7969f193f8dc8c1f1db0378d6243a8c +PODFILE CHECKSUM: a6a1ed03c5c3b533396e7e750375e4e80d12b86d COCOAPODS: 1.9.3 diff --git a/README.md b/README.md index 6f97e2d..82e5857 100644 --- a/README.md +++ b/README.md @@ -74,17 +74,24 @@ To launch it, type `sh rebuild.sh` in your console. ## ChangeLog +**4.8.0** + +- Added ability for manual delete exposure risk info + **4.7.1** + - Bump iOS version availability for some log methods - Clear exposure risk info on demand **4.7.0** + - Omit package analysis on very first app run - Added ability for sign-in for covid-19 test - Added js contract for high risk and covid-19 test - Added simulate exposure risk to debug panel **4.6.0** + - Added restricted districts feature - Added subscribing for notification for restricted districts - Small fixes for JS contract @@ -94,6 +101,7 @@ To launch it, type `sh rebuild.sh` in your console. - Remove debug logging from iOS < 13.5 **4.5.0** + - Manage user diagnosis keys share rejection - Prevents url requests caching - Added webkit local storage dump for debug panel in stage builds @@ -102,6 +110,7 @@ To launch it, type `sh rebuild.sh` in your console. - Added PWA to .gitignore file according to download it on CI/CD **4.4.0** + - Added translations for English and Ukrainian languages - Ability of change language in app runtime - Fix for multiple language managing @@ -110,9 +119,11 @@ To launch it, type `sh rebuild.sh` in your console. - Remove redundant data logging **4.3.1** + - Fix for incorrect date display for entries in Health Journal in PWA **4.3.0** + - In code multilanguage support (no UI yet) - Added validation for diagnosis keys upload - Added debug panel for sharing uploaded payloads and logs diff --git a/Scripts/RealmStripFrameworks.sh b/Scripts/RealmStripFrameworks.sh new file mode 100644 index 0000000..4784885 --- /dev/null +++ b/Scripts/RealmStripFrameworks.sh @@ -0,0 +1 @@ +bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh" \ No newline at end of file diff --git a/project.yml b/project.yml index e8b2d6b..837c58d 100644 --- a/project.yml +++ b/project.yml @@ -12,7 +12,7 @@ configs: settings: CODE_SIGN_STYLE: Manual - MARKETING_VERSION: "4.7.1" + MARKETING_VERSION: "4.8.0" CURRENT_PROJECT_VERSION: 745 schemes: safesafe Dev: diff --git a/safesafe/Services/ExposureNotification/DiagnosisKeysUploadService.swift b/safesafe/Services/ExposureNotification/DiagnosisKeysUploadService.swift index 030557a..8f544c6 100644 --- a/safesafe/Services/ExposureNotification/DiagnosisKeysUploadService.swift +++ b/safesafe/Services/ExposureNotification/DiagnosisKeysUploadService.swift @@ -9,7 +9,7 @@ import ExposureNotification protocol DiagnosisKeysUploadServiceProtocol { - func upload(usingAuthCode authCode: String) -> Promise + func upload(usingResponse jsResponse: UploadTemporaryExposureKeysResponse) -> Promise } @@ -21,7 +21,7 @@ enum UploadError: Error { @available(iOS 13.5, *) final class DiagnosisKeysUploadService: DiagnosisKeysUploadServiceProtocol { - + private enum Constants { static let dayIntervalSeconds: UInt32 = 86400 static let keyExpirationDays: UInt32 = 14 @@ -54,7 +54,7 @@ final class DiagnosisKeysUploadService: DiagnosisKeysUploadServiceProtocol { // MARK: - Exposure Keys - func upload(usingAuthCode authCode: String) -> Promise { + func upload(usingResponse jsResponse: UploadTemporaryExposureKeysResponse) -> Promise { var diagnosisKeys: [ENTemporaryExposureKey] = [] return getDiagnosisKeys() .then (validateKeysAtLeast) @@ -62,21 +62,25 @@ final class DiagnosisKeysUploadService: DiagnosisKeysUploadServiceProtocol { .then(validateKeysPerDayMax) .then { keys -> Promise in diagnosisKeys = keys - return self.getToken(usingAuthCode: authCode) - } - .then { token -> Promise in - let data = TemporaryExposureKeys( - temporaryExposureKeys: diagnosisKeys.map({ TemporaryExposureKey($0) }), - verificationPayload: token ) - let keysData = TemporaryExposureKeysData(data: data) - - #if !LIVE - File.saveUploadedPayload(keysData) - #endif - - return self.renewableRequest.make(target: .post(keysData)) - } - .asVoid() + return self.getToken(usingAuthCode: jsResponse.pin) + } + .then { token -> Promise in + let data = TemporaryExposureKeys( + temporaryExposureKeys: diagnosisKeys.map({ TemporaryExposureKey($0) }), + verificationPayload: token + ) + let keysData = TemporaryExposureKeysData( + data: data, + isInteroperabilityEnabled: jsResponse.isInteroperabilityEnabled + ) + + #if !LIVE + File.saveUploadedPayload(keysData) + #endif + + return self.renewableRequest.make(target: .post(keysData)) + } + .asVoid() } private func getDiagnosisKeys(filtered: Bool = true) -> Promise<[ENTemporaryExposureKey]> { @@ -102,7 +106,7 @@ final class DiagnosisKeysUploadService: DiagnosisKeysUploadServiceProtocol { } catch { throw error } - } + } } private func discardOldKeys(key: ENTemporaryExposureKey) -> Bool { @@ -133,7 +137,7 @@ final class DiagnosisKeysUploadService: DiagnosisKeysUploadServiceProtocol { private func validateKeysPerDayMax(_ keys: [ENTemporaryExposureKey]) -> Promise<[ENTemporaryExposureKey]> { let rollingPeriods = keys.map { ($0.rollingStartNumber, 1) } let rollingPeriodsCount = Dictionary(rollingPeriods, uniquingKeysWith: +) - + if rollingPeriodsCount.filter ({ $1 > Validation.keysPerDayMax }).count > .zero { UploadValidationAlertManager().show(type: .keysPerDayMax) { _ in } return .init(error: InternalError.uploadValidation) diff --git a/safesafe/Services/ExposureNotification/Download/Model/DiagnosisKeysDownloadInfoModel.swift b/safesafe/Services/ExposureNotification/Download/Model/DiagnosisKeysDownloadInfoModel.swift index f59f6de..c66ebbd 100644 --- a/safesafe/Services/ExposureNotification/Download/Model/DiagnosisKeysDownloadInfoModel.swift +++ b/safesafe/Services/ExposureNotification/Download/Model/DiagnosisKeysDownloadInfoModel.swift @@ -6,6 +6,7 @@ // import RealmSwift +import Foundation class DiagnosisKeysDownloadInfoModel: Object, LocalStorable { diff --git a/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeys.swift b/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeys.swift index dd6aa01..a661eed 100644 --- a/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeys.swift +++ b/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeys.swift @@ -19,5 +19,4 @@ struct TemporaryExposureKeys: Encodable { let platform = Default.platform let appPackageName = Default.appPackageName let verificationPayload: String - } diff --git a/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeysData.swift b/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeysData.swift index a0c8828..3588268 100644 --- a/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeysData.swift +++ b/safesafe/Services/ExposureNotification/Models/TemporaryExposureKeys/TemporaryExposureKeysData.swift @@ -8,4 +8,5 @@ import Foundation @available(iOS 13.5, *) struct TemporaryExposureKeysData: Encodable { let data: TemporaryExposureKeys + let isInteroperabilityEnabled: Bool } diff --git a/safesafe/Services/Free test/Model/Database/DeviceGUIDModel.swift b/safesafe/Services/Free test/Model/Database/DeviceGUIDModel.swift index 250dd93..a00d9e1 100644 --- a/safesafe/Services/Free test/Model/Database/DeviceGUIDModel.swift +++ b/safesafe/Services/Free test/Model/Database/DeviceGUIDModel.swift @@ -6,6 +6,7 @@ // import RealmSwift +import Foundation class DeviceGUIDModel: Object, LocalStorable { diff --git a/safesafe/Services/JavaScript Bridge/JSBridge.swift b/safesafe/Services/JavaScript Bridge/JSBridge.swift index c3f22b4..7be6af8 100644 --- a/safesafe/Services/JavaScript Bridge/JSBridge.swift +++ b/safesafe/Services/JavaScript Bridge/JSBridge.swift @@ -549,16 +549,18 @@ private extension JSBridge { if case .retry = action { self?.uploadTemporaryExposureKeys(jsonString: jsonString) } else if case .cancel = action { - self?.send(.other) + self?.send(.canceled) } } return } - guard let response: UploadTemporaryExposureKeysResponse = jsonString?.jsonDecode(decoder: jsonDecoder) - else { return } + guard let response: UploadTemporaryExposureKeysResponse = jsonString?.jsonDecode(decoder: jsonDecoder) else { + send(.canceled) + return + } - diagnosisKeysUploadService?.upload(usingAuthCode: response.pin) + diagnosisKeysUploadService?.upload(usingResponse: response) .done { self.send(.success) } @@ -567,9 +569,9 @@ private extension JSBridge { if let error = error as? InternalError { switch error { case .shareKeysUserCanceled: - self.send(.canceled) + self.send(.accessDenied) default: - self.send(.other) + self.send(.canceled) } } else { self.send(.failure) diff --git a/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysResponse.swift b/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysResponse.swift index 0a583c0..a47accc 100644 --- a/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysResponse.swift +++ b/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysResponse.swift @@ -10,5 +10,5 @@ import Foundation struct UploadTemporaryExposureKeysResponse: Codable { let pin: String - + let isInteroperabilityEnabled: Bool } diff --git a/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysStatusResult.swift b/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysStatusResult.swift index 12f0f30..3a72247 100644 --- a/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysStatusResult.swift +++ b/safesafe/Services/JavaScript Bridge/Models/UploadTemporaryExposureKeysStatusResult.swift @@ -8,8 +8,9 @@ import Foundation enum UploadTemporaryExposureKeysStatus: Int, Encodable { case success = 1 case failure = 2 - case other = 3 - case canceled = 5 + case canceled = 3 + case noInternet = 4 + case accessDenied = 5 } struct UploadTemporaryExposureKeysStatusResult: Encodable {