This source code is a property of Centre for Disease Prevention and Control (CDPC) of Latvia. You are free to use it accordingly to the Licence terms, and we would like to hear from you if you find it useful. Please drop us an email to: [email protected]
This project's goal is to delay and mitigate the impact of SARS-CoV-2 by developing the official Apturi Covid (Stop Covid) iOS application for the Republic of Latvia, utilising Apple's Exposure Notification Framework.
Only approved health authorities can access these APIs. Therefore, framework calls will result in API error unless the entitlement - com.apple.developer.exposure-notification
is granted to the application by Apple. The minimum deployment target is iOS 13.5 due to the availability of the Framework.
Application functionality is based on Apple's Exposure Notification Framework. Application directly is not interracting with Bluetooth LE in any way. The only capabilities application is using are Background Fetch
and Background Processing
in order to schedule Exposure Detection against the Framework in the background. Bluetooth key transmission and receiving is handled entirely by EN Framework. Please read more here regarding the implementation specifics of the Framework.
Application communicates with the server and exchanges information only to perform the following actions:
- Phone number verification (with user consent)
- Fetching exposure detection configuration. Detailed information here
- Downloading publicly available batches of TEKs (Temporary Exposure Keys)
- Uploading anonymous exposure events (with user consent)
Exposure Detection is performed at every application launch and in the background scheduled by BGTaskScheduler. Application stores last analysed batch index and at every task launch checks for new batches available and performs analysis.
Exposure Manager is the class that is responsible for the entire exposure detection. For more details please check ExposureManager.swift
- Install Xcode 11.5 or higher
- Make sure you have CocoaPods installed: installation instructions
- Install pods
pod install
- Add Firebase configuration
Place your
GoogleService-Info.plist
under the following directories:/environments/staging
/environments/production
- In case you are not an entitled authority and do not have
com.apple.developer.exposure-notification
- remove these entitlements from an according target.
Contributions and feedbacks are always welcome. If you have encountered and issue, have an improvement in mind or an implementation question, please use the issues section.
If you believe you have found a security vulnerability, please submit your report to us as described in the issues section.
This work is licensed under Creative Commons Attribution-ShareAlike 4.0 International