Answers for "Sample code Exposure Notification API"

0

Sample code Exposure Notification API

let nextDiagnosisKeyFileIndex = LocalStore.shared.nextDiagnosisKeyFileIndex

Server.shared.getDiagnosisKeyFileURLs(startingAt: nextDiagnosisKeyFileIndex) { result in
    
    let dispatchGroup = DispatchGroup()
    var localURLResults = [Result<[URL], Error>]()
    
    switch result {
    case let .success(remoteURLs):
        for remoteURL in remoteURLs {
            dispatchGroup.enter()
            Server.shared.downloadDiagnosisKeyFile(at: remoteURL) { result in
                localURLResults.append(result)
                dispatchGroup.leave()
            }
        }
        
    case let .failure(error):
        finish(.failure(error))
    }
Posted by: Guest on May-25-2020

Browse Popular Code Answers by Language