COVIDSafe code from version 1.9 (#18)

This commit is contained in:
COVIDSafe Support 2020-08-03 16:01:39 +10:00 committed by GitHub
parent 2257c542ed
commit 3b1d8fa3f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 4217 additions and 3998 deletions

View file

@ -11,6 +11,8 @@ import KeychainSwift
class GetTempIdAPI {
private static let apiVersion = 2
static func getTempId(completion: @escaping (String?, Int?, Swift.Error?) -> Void) {
let keychain = KeychainSwift()
guard let apiHost = PlistHelper.getvalueFromInfoPlist(withKey: "API_Host", plistName: "CovidSafe-config") else {
@ -24,9 +26,12 @@ class GetTempIdAPI {
let headers: HTTPHeaders = [
"Authorization": "Bearer \(token)"
]
let params = [
"version" : apiVersion
]
CovidNetworking.shared.session.request("\(apiHost)/getTempId",
method: .get,
encoding: JSONEncoding.default,
parameters: params,
headers: headers,
interceptor: CovidRequestRetrier(retries: 3)).validate().responseDecodable(of: TempIdResponse.self) { (response) in
switch response.result {