Client
protocol Client
Describes how to interfact with the backend.
-
Determines days that can be downloaded.
Declaration
Swift
func availableDays( forCountry country: String, completion: @escaping AvailableDaysCompletionHandler )Parameters
countryCountry code
completioncompletion callback which includes the list of available days
-
Determines hours that can be downloaded for a given day.
Declaration
Swift
func availableHours( day: String, country: String, completion: @escaping AvailableHoursCompletionHandler ) -
Fetches the keys for a given day and country code
Declaration
Swift
func fetchDay( _ day: String, forCountry country: String, completion: @escaping DayCompletionHandler )Parameters
dayThe day that the keys belong to
countryIt should be country code, like DE stands for Germany
completionOnce the request is done, the completion is called.
-
Fetches the keys for a given
hourof a specificday.Declaration
Swift
func fetchHour( _ hour: Int, day: String, country: String, completion: @escaping HourCompletionHandler )
-
Gets the registration token
Declaration
Swift
func getRegistrationToken( forKey key: String, withType type: String, isFake: Bool, completion completeWith: @escaping RegistrationHandler ) -
Undocumented
Declaration
Swift
func getTestResult( forDevice registrationToken: String, isFake: Bool, completion completeWith: @escaping TestResultHandler ) -
Undocumented
Declaration
Swift
func getTANForExposureSubmit( forDevice registrationToken: String, isFake: Bool, completion completeWith: @escaping TANHandler )
-
Submits exposure keys to the backend. This makes the local information available to the world so that the risk of others can be calculated on their local devices.
Declaration
Swift
func submit( payload: CountrySubmissionPayload, isFake: Bool, completion: @escaping KeySubmissionResponse )Parameters
payloadA set of properties to provide during the submission process
isFakeflag to indicate a fake request
completionthe completion handler of the submission call
-
fetchDays(_:Extension methodforCountry: completion: ) Fetch the keys with the given days and country code
Declaration
Swift
func fetchDays( _ days: [String], forCountry country: String, completion completeWith: @escaping (DaysResult) -> Void ) -
fetchDays(_:Extension methodhours: of: country: completion: ) Undocumented
Declaration
Swift
func fetchDays( _ days: [String], hours: [Int], of day: String, country: String, completion completeWith: @escaping DaysAndHoursCompletionHandler ) -
fetchHours(_:Extension methodday: country: completion: ) Undocumented
Declaration
Swift
func fetchHours( _ hours: [Int], day: String, country: String, completion completeWith: @escaping FetchHoursCompletionHandler )