Covtakt is the reference implementation of BlueTrace / OpenTrace.
BlueTrace is a privacy-preserving protocol for community-driven contact tracing across borders. It allows participating devices to log Bluetooth encounters with each other, in order to facilitate epidemiological contact tracing while protecting users’ personal data and privacy. Visit https://bluetrace.io to learn more.
The Covtakt reference implementation comprises:
- iOS app: bvantagelimited/covtakt-ios
- Android app: bvantagelimited/covtakt-android
- Cloud functions: bvantagelimited/covtakt-backend
- Install the latest Xcode developer tools from Apple
- Install CocoaPods
- Clone the repository
- Run
pod install
at root of project
The app relies on Firebase functions to work. More information can be obtained in the backend repository.
-
After setting up Firebase, place your configuration files in the respective directories.
|-- /FIREBASE |-- /PROD |-- GoogleService-Info.plist |-- /STG |-- GoogleService-Info.plist
-
In
Targets > Covtakt > Build Phases > Setup Firebase Environment GoogleService-Info.plist
, you will find the code that is used to copy the Plist files into the Plist destination. -
In
Targets > Covtakt > Info > URL Types
, insert the GoogleService-Info.plistREVERSED_CLIENT_ID
in URL schemes.
You can find BlueTrace config variables at BluetraceConfig.swift
.
To configure STG and PROD variables, define them in Targets > Covtakt > Build Settings > User-Defined
and declare them in Info.plist
.
These are some of the User-Defined variables.
PRODUCT_BUNDLE_IDENTIFIER
FIREBASE_STORAGE_URL
SERVICE_UUID
V2_CHARACTERISTIC_ID
Screenshot of User-Defined
Screenshot of Info.plist
Find ConsentViewController.swift
and replace the placeholder with your privacy statement URL.
@IBAction func privacySafeguardsBtn(_ sender: Any) {
// check if website exists
guard let url = URL(string: "<PRIVACY_STATEMENT_URL>") else {
return
}
...
Check your registered region then update it in FirebaseAPIs.swift (line 5) , UploadDataStep2VC.swift (line 20) and EncounterMessageManager.swift (line 12)
More: https://firebase.google.com/docs/functions/locations
The "Share" message uses Firebase remote config. The key is "ShareText". If it is unable to be retrieved, the app falls back to defaultShareText
.
There is a debug screen accessible within the staging version of the app. This allows you to view the app's Bluetooth communication log. To access it, you first have to set up the app. Then, tap on the home screen image.
change the config of Auth.auth().setAPNSToken(deviceToken, type: .sandbox) to Auth.auth().setAPNSToken(deviceToken, type: .prod)
There's a build script in Targets > Covtakt > Build Phases > Swiftlint
which runs SwiftLint on Build.
Run {PODS_ROOT}/SwiftLint/swiftlint autocorrect
to auto-fix some linting errors.
SSL pinning is not included as part of the repo
The following is a statement from Apple: "To ensure the credibility of health and safety information, Apple is only accepting COVID-19 related apps from recognised entities such as government organisations, health-focused NGOs, companies deeply credentialed in health issues, and medical or educational institutions. Only developers from one of these recognized entities should submit an app related to COVID-19 to the App Store.
For more information visit https://developer.apple.com/news/?id=03142020a"
iOS has limitations on background Bluetooth activity. Details are documented in the white paper at https://bluetrace.io.