Skip to content

Commit 06d1b9a

Browse files
authored
Merge pull request #123 from ProteGO-Safe/release/4.7.1
Release/4.7.1
2 parents 49a9904 + 5279675 commit 06d1b9a

File tree

8 files changed

+54
-5
lines changed

8 files changed

+54
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/).
88

9+
## 4.7.1
10+
- Bump iOS version availability for some log methods
11+
- Clear exposure risk info on demand
12+
913
## 4.7.0
1014
- Omit package analysis on very first app run
1115
- Added ability for sign-in for covid-19 test

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,4 @@ SPEC CHECKSUMS:
206206

207207
PODFILE CHECKSUM: 3b4c80f3b7969f193f8dc8c1f1db0378d6243a8c
208208

209-
COCOAPODS: 1.9.1
209+
COCOAPODS: 1.9.3

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ To launch it, type `sh rebuild.sh` in your console.
7474

7575
## ChangeLog
7676

77+
**4.7.1**
78+
- Bump iOS version availability for some log methods
79+
- Clear exposure risk info on demand
80+
7781
**4.7.0**
7882
- Omit package analysis on very first app run
7983
- Added ability for sign-in for covid-19 test

project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ configs:
1212

1313
settings:
1414
CODE_SIGN_STYLE: Manual
15-
MARKETING_VERSION: "4.7.0"
15+
MARKETING_VERSION: "4.7.1"
1616
CURRENT_PROJECT_VERSION: 745
1717
schemes:
1818
safesafe Dev:

safesafe/Common/Files/File.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class File {
2727
}
2828
}
2929

30-
@available(iOS 13.0, *)
30+
@available(iOS 13.4, *)
3131
static func append(data: Data, to fileName: String, in directory: URL) {
3232
let fileURL = directory.appendingPathComponent(fileName)
3333
if FileManager.default.fileExists(atPath: fileURL.path) {
@@ -54,7 +54,7 @@ extension File {
5454
return nil
5555
}
5656

57-
@available(iOS 13.0, *)
57+
@available(iOS 13.5, *)
5858
static func logToFile(_ message: String) {
5959
guard let data = message.appending("\n").data(using: .utf8) else { return }
6060
do {

safesafe/Services/ExposureNotification/ExposureSummaryService.swift

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
protocol ExposureSummaryServiceProtocol: class {
1111

1212
func getExposureSummary() -> ExposureSummary
13-
13+
func clearExposureSummary() -> ExposureSummary
1414
}
1515

1616
final class ExposureSummaryService: ExposureSummaryServiceProtocol {
@@ -57,6 +57,24 @@ final class ExposureSummaryService: ExposureSummaryServiceProtocol {
5757
return summary
5858
}
5959

60+
func clearExposureSummary() -> ExposureSummary {
61+
guard let allExposures: [Exposure] = storageService?.fetch() else {
62+
return getExposureSummary()
63+
}
64+
65+
storageService?.beginWrite()
66+
67+
storageService?.remove(allExposures, completion: nil)
68+
69+
do {
70+
try storageService?.commitWrite()
71+
return getExposureSummary()
72+
} catch {
73+
console(error, type: .error)
74+
return getExposureSummary()
75+
}
76+
}
77+
6078
// MARK: - Private methods
6179

6280
/// Removes expired data from local storage.

safesafe/Services/JavaScript Bridge/ExposureNotificationJSBridge.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ protocol ExposureNotificationJSProtocol: class {
1313

1414
func enableService(enable: Bool) -> Promise<Void>
1515
func getExposureSummary(shouldDownload: Bool) -> Promise<ExposureSummary>
16+
func clearExposureRisk() -> Promise<ExposureSummary>
1617
}
1718

1819
extension ExposureNotificationJSProtocol {
@@ -86,6 +87,12 @@ final class ExposureNotificationJSBridge: ExposureNotificationJSProtocol {
8687
}
8788
}
8889

90+
func clearExposureRisk() -> Promise<ExposureSummary> {
91+
Promise { seal in
92+
seal.fulfill(self.exposureSummaryService.clearExposureSummary())
93+
}
94+
}
95+
8996
// MARK: - Private methods
9097

9198
private func turnOnService() -> Promise<Void> {

safesafe/Services/JavaScript Bridge/JSBridge.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ final class JSBridge: NSObject {
2727
case exposureList = 61
2828
case appVersion = 62
2929
case systemLanguage = 63
30+
case clearExposureRisk = 66
3031

3132
case allDistricts = 70
3233
case districtsAPIFetch = 71
@@ -255,6 +256,9 @@ extension JSBridge: WKScriptMessageHandler {
255256
case .freeTestPinCodeFetch:
256257
freeTestPinCodeFetch(requestID: requestId, dataType: bridgeDataType)
257258

259+
case .clearExposureRisk:
260+
clearExposureRisk(requestID: requestId, dataType: bridgeDataType)
261+
258262
default:
259263
return
260264
}
@@ -434,6 +438,18 @@ private extension JSBridge {
434438
console($0, type: .error)
435439
}
436440
}
441+
442+
func clearExposureRisk(requestID: String, dataType: BridgeDataType) {
443+
exposureNotificationBridge?.clearExposureRisk()
444+
.done { [weak self] summary in
445+
if let body = self?.encodeToJSON(summary) {
446+
self?.bridgeDataResponse(type: dataType, body: body, requestId: requestID)
447+
}
448+
}
449+
.catch {
450+
console($0, type: .error)
451+
}
452+
}
437453
}
438454

439455
// MARK: - onBridgeData handling

0 commit comments

Comments
 (0)