This is an iOS application for ProteGO Safe project and it implements two main features:
User daily triage
Contact tracing - module that is fully based on Exposure Notification API provided by Google and Apple and it's goal is to inform people of potential exposure to COVID-19.
Application is structured based MVVM-C pattern, where presentation (UI) layer is almost fully realized with a single UIViewController with a WKWebView that loads a website application called 'PWA' (Progressive Web App). PWA is responsible for GUI, user interaction and 'User daily triage' feature. Website app interacts with native code through the JavaScript bridge.
App implements contact tracing module that is based on Exposure Notification API (EN) and we can extract couple of features related to this:
Controlling EN: enable/disable, check if device supports it, check what is its state
Uploading Temporary Exposure Keys (TEKs) of positively diagnosed user verified by the application: authorize user for TEKs upload, get TEKs from EN, add proper verification data (using DeviceCheck Framework), upload data to the Cloud Server.
Downloading periodically files with batch of TEKs of positively diagnosed users (that recently uploaded their TEKs): execute periodic task responsible for downloading recently created .zip files (it fetches list of available files from CDN, selects only not yet analyzed files and downloads only these ones)
Providing files to EN API for detecting exposures: get proper configuration for risk calculation (Exposure Configuration), fire EN API with list of downloaded files and configuration, delete analyzed files
Receiving information about detected exposures: register broadcast receiver about exposures, get information about exposures, store part of information (day of exposure, risk score and duration that is in 5 minutes intervals but max 30 minutes)
Reporting risk level to the PWA: extract risk scores of saved exposures and calculate risk level, pass risk level to PWA
App - contains classes related to app's life cycle
Common - contains app's extensions, helpers etc.
Components/PWA - module containing classes responsible for managing PWA's logic
DependencyContainer - contains DI implementation, including factories for PWA and app's services
Networking - implementation of app's networking logic, based on Moya framework
Resources - module containing app's assets, entitlements and configuration files
Services - module containing majority of apps business logic. Services are described in more detail in services overview section
Services overview
AppManager - service which holds info about app's first launch
ConfigManager - service that provides a proper configuration based on currently used environment (Dev/Stage/Live)
DeviceCheckService - service responsible for providing a valid verification payload for uploaded TEKs
KeychainService - service responsible for managing Keychain related activities
NotificationManager - service responsible for managing push notification related activities
StoredDefaults - service managing logic related to UserDefaults
ServiceStatusManager - service that gathers data about statuses of permissions and states of Notifications and Exposure Notification services
BackgroundTasksService - service which is responsible for scheduling backround tasks in the app. Each background task is meant to perform an exposure detection, based on periodically downloaded TEKs
ExposureService - service responsible for implementing exposure detection part of Exposure Notification API
ExposureSummaryService - service responsible for providing information about potential exposure risk
Environments
Application has 3 different environments: Dev, Stage and Live.
Each environment has different configuration files - they are respectively divided in safesafe/Resources directory.
Each environment uses:
[env].entitlements file
Config-[env].plist file, which contains appropriate PWA links and (legacy) BlueTrace configurations
[env].xcconfig and [env]Dist.xcconfig Xcode config files
GoogleService-Info-[env].plist files (those names are modified in one of build scripts, so that for compilation phase file's name is changed to GoogleService-Info.plist)
There are two build configurations for each environment: debug and release
To setup the project, proceed with following steps:
Open terminal and go to project's directory
Run xcodegen generate to generate .xcodeproj file
Run pod install to install necessary dependencies and generate .xcworkspace file
For convenience, there's a rebuild.sh script which performs actions mentioned above. Aditionally, it let's you select Xcode that you want to use to open the project (if you have multiple Xcode versions on your machine).
To launch it, type sh rebuild.sh in your console.
ChangeLog
4.13.0
Updated UI
Added handling deeplinks
Added handling redirect to sms
4.12.0
Disabled DeviceCheck for lab test
Updated UI
4.11.0
Updated UI
4.10.0
Added new file storage method
Split current JSON data to multiple smaller data files to prevent over downloading unwanted data
Enhanced view of the app home screen, which now includes more detailed statistics on vaccination and infections
New screen with detailed statistics and graphs on vaccination (number of people vaccinated, doses, adverse reactions) and infections (number of people infected, recovered, deaths, causes of death and tests)
Added information on vaccination and registration rules with redirection to registration, vaccination request and helpline
4.9.1
Added Vaccination stats to dashboard
4.9.0
Added COVID daily stats
Added subscription for COVID daily stats push notifications
Added ability to unsubscribe from daily COVID stats push notification
Added localized push notifications
Added push notifications history
Added deep linking for push notifications
Added Universal Links for deep linking
Added local notifications (aka Districts Info) to notifications history
Removed passing push notification payload to UI (aka PWA)
请发表评论