GithubHelp home page GithubHelp logo

ukhsa-collaboration / covid-19-app-ios-beta Goto Github PK

View Code? Open in Web Editor NEW
802.0 77.0 178.0 43.96 MB

Source code of the Beta of the NHS COVID-19 iOS app

Home Page: https://covid19.nhs.uk/

License: MIT License

Objective-C 77.29% C 6.95% Swift 9.04% HTML 0.14% Shell 1.43% Ruby 0.36% Python 4.79%

covid-19-app-ios-beta's Introduction

NHS COVID-19

License: MIT Release: BETA

This application runs in the background and identifies other people running the app within the local area by using low energy Bluetooth. While the app is running permanently in the background, it periodically broadcasts and listens for other Bluetooth-enabled devices (iOS and Android at this time) that also broadcast the same unique identifier.

How it works

Our unique identifier is also known as our service characteristic. In the Bluetooth spec, devices can broadcast the availability of services. Each service can have multiple characteristics. We use a characteristic to uniquely identify our service and distinguish from all other sorts of Bluetooth devices.

For every device we find with a matching characteristic, we record an identifier for the device we saw, the timestamp, and the RSSI of the Bluetooth signal, which will allow a team later on to determine who was in close proximity to individuals infected with the novel coronavirus.

Functionality

  • Passively collect anonymized ids of other users of the app that the device has been in proximity with (stored locally on the device)
  • Allow the user to submit their "contact events" to NHS servers
  • Receive push notifications from NHS and inform the user of their exposure status

Development

Setup

cp Sonar/Environments/Sonar.xcconfig.sample .secret/Sonar.xcconfig
./bin/make-environment < Sonar/Environments/environment.json > .secret/Environment.swift
  • Fill in the Environment.swift file with the appropriate values from another developer.
  • Get a copy of GoogleService-Info.plist from one of the other developers and copy that into the .secret directory.
  • Create .secret/RegistrationCanaryEnvironment.swift with the following contents:
struct RegistrationCanaryEnvironment {
    static let apnsProxyHostname = "YOUR_HOSTNAME_OR_IP_ADDRESS"
}
  • If Xcode is open, restart Xcode. Xcode does not handle configuration files being changed out from under it gracefully.

MoreStatusStateMachineTests

TODO https://nshipster.com/swift-gyb/

  • why do blocks?

Registration Canary

The registration canary is a diagnostic tool that helps assess the health of both the entire registraton system and APNS. See RegistrationCanary/README.md for more information.

Setup for Pact Testing

Run bin/pact/setup to install all necessary libraries, and install Sonar CA and trust it on all running Simulator devices.

You can then proceed as indicated in the README of the Swift Pact Consumer library to create pact tests. A mock service will be spun up for you before tests on https://localhost:1234 using a build step before action, and torn down afterwards.

If you get an SSL or ATS error when running the tests, re-run bin/pact/setup to ensure that all devices have the Sonar CA setup correctly.

Pact Setup Context

Contract testing requires a mock server to be running that we can verify contracts against. This is done by pact-mock-service which is installed as a Ruby library (gem). Once the contract is defined, it is then uploaded to the pact broker, which is done via pact-broker, also installed as a Ruby gem.

In order to satisfy App Transport Security (ATS) requirements, the setup involves a certificate for localhost that is issued by a Certificate Authority (CA) created for this project, Sonar CA. This is necessary since self-signed certificates are not accepted by ATS.

The certificate has a TTL of 2 years. When it expires, you will need to create a new Sonar CA, export the keys and generate a new certificate since we won't be including the CA private key here. This is to avoid any devices being used for testing accidentally becoming vulnerable to MitM.

The setup then installs the certificates in the simulator's SQLite trust store database using the ADVTrustStore library. It has been vendored and modified in order to not require user input so we're able to run it in CI.

We're then using the UI testing framework, specifically TrustSonarCARootCertTest to trust the Sonar CA root certificate on all booted simulator devices.

Pact tests are in a separate scheme since we do need to inject https://localhost:1234 as the API endpoint. This is done via script in pre-action (bin/pact/setup-build-environment). We want to avoid rewriting the file for other debug builds such as the ones you push to your phone.

Notifications

The app currently relies on remote (as opposed to push) notifications, which we unfortunately have not been able to trigger on the Simulator. Push notifications (in the form of .apns files) can be dragged onto a Simulator window or passed into simctl, but remote notifications are only delivered on devices.

There are currently a couple ways to do development with remote notifications:

  • ./bin/pu.sh is a script forked from pu.sh. There are instructions there for obtaining credentials from an Apple Developer account. However, we are out of available APNs keys, so you'll need to obtain that from another developer. Run the script with the path to one of the example notifications to send a remote notification through Apple: ./bin/pu.sh "Example Notifications/2_potential_diagnosis.apns. You will also need to set the following environment variables to configure the script:
    • TEAMID
    • KEYID
    • SECRET - the fully expanded path to the .p8 key.
    • BUNDLEID
    • DEVICETOKEN - retrieved from the console when running the application.

Releases

Code is truth. See the GitHub Actions configuration for the current behavior of the system. (And please update this documentation if it's wrong!)

Continuous Delivery

All pushes get built (for both simulator and device) and tested (on iOS 12 and 13). The TestResult.xcresult file is archived for future reference. Successful pushes on master get promoted to internal. Every hour, if the tip of internal hasn't been deployed, we bump the build number and trigger a deployment to the internal and beta apps, which will cut a release build and upload it to Apple.

Once the builds are uploaded, they go through App Store processing. Once that finishes, there are some manual steps that need to be done by someone with App Manager+ permissions in App Store Connect in order to release the build to testers:

  1. Add Export Compliance Information to the build
  • This will release the build to App Store Connect Users
  1. Add the build to the appropriate test groups

Branches and Versions and Build Numbers, Oh My!

The release process caters for our normal use case, since with trunk-based development and continuous delivery, we can select a specific commit to promote as a production release.

However, this optimization means that the process for creating a release that is not based off trunk (internal for releases, as master is trunk for development) requires more manual intervention. For example, cutting a hotfix release from a previous release commit will generally require a branch with the necessary changes and a manual build number bump. The release process then continues as normal, by deploying from the commit to a specified environment.

Deploying to Production

To trigger a release manually, set the following environment variables:

DEPLOYMENT_TOKEN="" # obtain one from here: https://github.com/settings/tokens
GITHUB_REPOSITORY="nhsx/<repository-name-here>"
DEPLOYMENT_SHA="<sha of commit you want to release>"

Run the following command:

./bin/create-deployment <beta/internal/production>

Setup/Configuration

The app's configuration is driven through three files in the .secret directory:

  • Sonar.xcconfig
    • This is a pointer at one of the app configurations in Sonar/Environments. These mostly capture the differences for our separate applications in App Store Connect.
  • Environment.swift
    • Configuration that gets injected in at build time in CI. Developers should generate a copy that points at the test environment for local development.
    • There's a script that takes a JSON file (example) and the template and generates a valid Environment.swift file for the build.
  • GoogleService-Info.plist
    • Needed for Firebase.

CI configuration requires the following secrets:

  • apple_username, apple_password
    • Used for uploading to App Store Connect.
  • deployment_token
    • Used for yo-dawg-ing CI. (Sensibly, GitHub Actions doesn't allow recursive triggering of CI workflows from other CI workflows via the built-in token, so we need to use our own for this purpose.)
  • environment_json_{environment},google_service_info_{environment}
    • Per-environment app configuration.
  • match, match_password
    • Used by fastlane to set up credentials for building a distributable version of the app. See below for the gory, gory details.
  • pivotal_tracker_api_token, pivotal_tracker_project_id, tracker_api_token
    • For automatically updating the backlog from story IDs in commits.
  • slack_bot_token
    • Lets us know when we've broken CI in Slack.

Fastlane Match

Since we don't want to manually upload builds to App Store Connect and we don't want to write that automation ourselves, that pretty much leaves us with fastlane's upload_to_testflight action.

Long story short, we need to have a certificate and provisioning profile set up to build the app. These are secrets, and we do not want to expose them to the world. The path of least resistance with Fastlane is to use match, but this conflicts somewhat with our team and development structure - we don't want to force other dev teams to use fastlane or match, so we can't have match manage the setup, and we also don't have a separate repo to use for match[1]. We also want to continue using Xcode's "automatically manage signing" option for development.

[1] In hindsight, I wish we had explored this option further, but we have what we have now and it works, although in an unnecessarily complicated manner.

In theory, we should be able to use cert and sigh to manage the credentials as secrets, but I was unable to get that to work in CI. (This would really be the ideal way to handle this.) Instead, what we have is a monstrous hack around match, where we keep a stub of the match repo in source and a tar of the certs and profiles as a secret in CI, and then create the match repo in CI.

That might not seem too bad, but it's the setup of the match repository that gets hairy. There's undoubtedly a better way to do this, but this works. Here it is from memory, unfortunately, since I didn't write this down either time I set it up:

  1. Create a git repository for match locally that matches the stub in this repository (ci/match).
  2. Switch to a branch that's not master so that match can use master.
  3. Initialize match (fastlane match init) pointed at the local repo.
  4. Get certs and profiles via match (fastlane match appstore). This should store the secrets in the local repository, encrypted.
  5. Tar up the certs and profiles into a secrets-compatible format. Something like tar cvz ci/match/certs ci/match/profiles | base64 > match.b64, but I don't remember the exact command. Regardless, you should be able to dump it into a MATCH environment variable and then run ./bin/setup-match in the root of this repo and see the certs and profiles get populated into ci/match. If this didn't work, these steps should be enough to mostly point you in the right direction and hopefully you'll come back and update these steps to be accurate when you do figure it out.

covid-19-app-ios-beta's People

Contributors

adamfowleruk avatar edent avatar testtest2227 avatar tjarratt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

covid-19-app-ios-beta's Issues

Documentation update - registration process

Describe the bug
The README.md could be enriched with a description of the registration process. If someone could help and submit a pull request, with the changes suggestion after verification of what I say...

To Reproduce
How it works only provide very high level description.

Expected behaviour
Add a section at the end maybe...

Additional information

Registration process

  • Send registration request (to Google FCM Firebase Cloud Messaging) (in Sonar/Registration/ConcreteRegistrationService.register() via notificationCenter.addObserver(forName: PushTokenReceivedNotification, ...))
    • receive FCM pushToken and call requestRegistration(pushToken)
    • send confirmRegistration/secondRegistration request (to NHS?/api/devices) with activationCode, FCM pushToken, partialPostCode (provided by user) via ResgistrationService::requestRegistration (moreover networking/RequestFactory::registrationRequest(pushToken) enrich the request with deviceModel and OSVersion before submission)
    • on response, define registration as:
      • id from response.id (provided by server)
      • secretKey from response.secretKey (provided by server), our Key?
      • broadcastRotationKey from response.serverPublicKey (after convertion by Bluetooth/BroadcastIdBroadcastRotationKeyConverter::fromData)
      • Stored in KeyChain in 2 part:
        • partialRegistration = id+secretKey (via SecureRegistrationStorage.set)
        • broadcastRotationKey (via SecureBroadcastRotationKeyStorage.save)

Validation of backgrounded service behaviour 'in the wild'...?

With reference to the discussion in issue #2, I have some questions:

In reality, on iOS, backgrounded services can often be killed if one launches other apps that require a lot of RAM, e.g. games, or even visiting big webpages.

I am curious to know how the effectiveness of the app's backgrounded services is monitored, if at all, outside of 'laboratory'/test conditions?

Are there any built-in (opt-in) diagnostic analytics to monitor whether this is actually working as expected/intended in real-life / in the wild, under regular users' normal usage patterns?

Or is this understanding of backgrounded services' behaviour based solely upon on observations made during test conditions?

"To measure is to know"

Thanks.

GDPR Compliance

According to the review here: https://osf.io/preprints/lawarxiv/6fvgh

There are several GDPR compliance problems that must be cleaned up before this app can legally be allowed to be released and used by people in the European Union.

Page 6: Deprivation of the right of erasure (GDPR, art 17)
"The NHSX App appears to deny people access to the right to erasure (also called the 'right to be forgotten') without a specified lawful reason for doing so"

"The data can be deleted as long it is on your own device. Once it is uploaded, it becomes enmeshed in wider data, and the technical difficulties of deleting it at that point become tricky"

This would be a violation of the GDPR. Since you are obliged to delete data from your system on request by the user. It would be illegal and contrary to the law itself to release an application which specifically denies this right as a purposely built in functionality.

Then there is another issue:
Page 7: Unlawful deprivation of the right of access (GDPR, art 15)

Again, contrary to the law and legal obligations.

If you continue to read this document, you find more and more privacy violations and issues with its data collection and retention techniques.

It appears that the NHS application is being built deliberately to violate that law despite it being subject to fines to do so.

It appears that the NHS is planning to just steamroll over peoples privacy with an application on the premise of a "Install it or you might die" scare tactic and bully people into giving up their rights despite laws already enacted and in place to protect those rights and in the hope that people don't file lawsuits in order to draw attention to these privacy and legal violations.

It's morally wrong to give people this choice. Install a privacy violating phone tracking application, or suffer the consequences of potentially dying.

Steamrolling over peoples rights like this cannot be allowed to become an acceptable practice and allowing this application to do that will encourage other more unscrupulous people to take things a step further.

Please tag releases

Describe the bug
No way to identify the commit for each release and know what fixes are included please tag releases in some way so production behaviour can be verified against the code.

Expected behaviour
Tags such as release_1.0 and release_1.0.2 should be added at the correct places.

NHS Bundle Id ok with IOS Simulator on OSX - bit fails to build for real iOS device

Hello I am new to GitHub and Xcode.
I have managed to load and run the NHS tacker app via an IoS simulator on my mac book pro.
However when I try to port the App to my iPhone or iPad the build fails with these errors:

Failed to register bundle identifier. The app identifier "uk.nhs.nhsx.sonar.internal" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again.

Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the aps-environment entitlement.

No profiles for 'uk.nhs.nhsx.sonar.internal' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'uk.nhs.nhsx.sonar.internal'.

I am sorry if this the wrong place to ask this question but does anybody have a potential solution please.
Thank you
Regards
Ken

error running ./bin/make-environment

After creating the .secret directory and copying the xconfig file I execute the make-environment script and the following is output.

steve@zephyr COVID-19-app-iOS-BETA % ./bin/make-environment < Sonar/Environments/environment.json > .secret/Environment.swift
./bin/make-environment:9:in `<main>': undefined method `result_with_hash' for #<ERB:0x007fc399a20850> (NoMethodError)

Is this a ruby version issue?

was an army base a suitable test environment

I wonder whether strolling around an army base offers a realistic test of the RSSI distance measurement issues that will be encountered in the civilian work/shopping environment

Did you also test by having subjects walking around an actual supermarket? Office and Supermarket buildings are very often constructed in a cage-like structure, with lots of steel beams and supports, and offer very different Faraday cage effects to a purely brick-built home structure (or army barrack).

Blocks iOS devices ability to connect to other bluetooth devices

Describe the bug
When the app is installed, but not in the foreground, the iOS device cannot connect to certain bluetooth devices at all and cannot connect to others without turning the bluetooth stack off and on again
To Reproduce
Steps to reproduce the behaviour:

  1. Install NHS CoVID app
  2. Make first run
  3. leave bluetooth enabled
  4. device will not connect to RENPHO Smart scales at all
  5. device will not connect to fitbit devices without turning bluetooth off and on again
  6. only permanent fix is to uninstall NHS app, at which point all functionality returns to normal.

Expected behaviour
NHS CoVid App should not affect the devices ability to connect to other bluetooth devices.

Smartphone (please complete the following information):

  • Device: iPhone Xr
  • OS: iOS
  • Version 13.4.1
  • Modem Firmware: 2.05.13

Additional context
Inability to connect to pre existing devices will cause user frustration and lead to uninstallation from device, hampering ongoing tracking efforts.

Google API

Where can I find the source code for the version of the app that is using the Apple/Google API. Are you guys working on that too?

Individuals are tracked by Google Analytics.

Describe the bug

Individuals are tracked by Google Analytics.

When accessing the Privacy Policy tracking code is passed from the application to the covid19.nhs.uk website which is processed by Google Analytics. Data captured could be used to re-identify an individual.

https://github.com/nhsx/COVID-19-app-iOS-BETA/blob/370a51857b8a680925adc85bfc2e08936a2fd77d/Sonar/Appearance/LogoStrapline.swift#L45-L48

Expected behaviour

Individuals are NOT tracked by Google Analytics

How to get values for Environment.swift

What exactly the values for below ones.

static let appCenterKey = "an-api-key"
static let sonarHeaderValue = "a-header-value"
static let sonarServiceUUID = CBUUID(string: "an-uuid")
static let sonarIdCharacteristicUUID = CBUUID(string: "another-uuid")
static let keepaliveCharacteristicUUID = CBUUID(string: "yet-another-uuid")


static let debug: Debug? = Debug(
    registrationId: "an-uuid",
    registrationSecretKey: "a-base46-secret-key",
    registrationBroadcastRotationKey: "a-base64-broadcast-rotation-key"
)

Discovery fails when both devices are locked

Describe the bug
I've been trying to see how the app works around the issue where an iOS app central cannot discover an iOS app peripheral on another device if they are both in the background (and/or the device is locked).

I did a lot of initial testing of this with an Apple sample project yesterday and could not find a way to make it work and am able to reproduce this problem with the COVID-19 app as well.

A few notes, I've had to make a few small mods to get the app running on my device to the point where it's actively scanning and broadcasting:

  • Disabled remoteNotificationManager.configure() in the app delegate to bypass Firebase
  • Faked registration by creating my own Registration, using the device advertising identifier as the UUID and a fake secret/SecKey.
  • Commented out the peripheral state restoration code in the broadcaster so my two test devices always appear as new devices to each other.

To Reproduce

  1. Install app on two iOS devices. In my test I'm using an iPad and an iPhone.
  2. Install the app on the iPhone, launch the app and make sure its working. Kill the app, turn on Airplane mode.
  3. Install the app on the iPad, launch the app, make sure its working (I'm running this one attached to the debugger so I can watch the log output). Background the app (verify using logs) and lock the device.
  4. Move out of range of the iPad with the iPhone, wake the iPhone up, disable Airplane mode, launch the app, close the app, lock the device.
  5. Move in to range of the iPad and observe no log output - the didDiscover delegate method is not being called on the iPad.
  6. Wake the iPad screen by pressing the home button - the didDiscover delegate is called and it springs to life.

Expected behaviour
This was the behaviour I expected based on my previous testing however I was lead to believe that a way had been found around this limitation.

My understanding of the problem is thus:

  • iOS apps acting as a peripheral do not broadcast their service UUID in the advertising packet while they are broadcasting in the background. The service UUID is stored in an "overflow area" to quote the Apple docs.
  • iOS apps acting as a central can only find other iOS peripherals by scanning for a specific service UUID if when they are running in the background - because the other device is not broadcasting it's service UUID, it doesn't find it.
  • If either app is in the foreground, the connection is made - either the central is in the foreground and is able to find the peripheral without relying on the service UUID being advertised or the peripheral is in the foreground and is broadcasting it's service UUID so the backgrounded central can find it.

Smartphone (please complete the following information):
I'm using an iPhone XS and an iPad mini 4 running the latest version of iOS 13.

EDIT - some further detailed scenarios below.

Use of Apple Watch App for user engagement & background waking

NB. This thought is a bit outside the box, it may have flaws, but was hoping to float the idea.

Apple Watch. I'm not sure exactly what percentage of iPhone users have one but I believe it could be as high as 20% Source.
How about implementing a basic Apple Watch app with complications showing a green or a red symbol almost like a traffic light to confirm contact tracing is working for the user.
This could be done with a WatchConnectivity handshake to confirm the app is still ok every time the complication updates (usually every ~15 minutes). This will mean that:

  • The regular WCSession calls from watch will wake the iPhone app potentially helping the background bluetooth issues discussed in #2 !
  • The user will be more engaged to keep an eye on the app.
  • The user will have a visual guide that the app is working correctly.

I appreciate 20% is by no means everyone, but it could be an important number of people to make the difference on the number of devices out and about that are awake. Implementing the app would also be fairly trivial and could be simply added on as an extra for those who want it and have an Apple Watch.

As a further extension, Apple Watch devices to have access to the CoreBluetooth framework so there is a possible future to explore in using them to do some waking.

Smartphone:

  • iPhone running iOS 8 & later
  • Ideally Apple Watch Series 3 or greater for WatchOS 6 & CoreBluetooth, but any model will do

Allow users to see infection statistics about their current location

Describe the bug/improvement
A potential improvement to the app to improve the number of people who download it would be to provide statisics of the current number of infections in the users area and so the current risk to the user of contracting Covid 19.

Given that the app asks users to inform them if they have symptoms and this information is transmitted to the central server. The app could provide a report of the percentage of people who have reported symptoms in the users current vicinity in the last 10 days and the rate of increase of reports in that vicinity This could be used to provide a localised green, amber or red score for the area.

Such information would make the app more useful to people and so increase the liklihood of downloading it which makes it more effective. It would also allow people to avoid riskier areas in real time which would itself lower the rates of infection in a hotspot.

Such a feature would require the app to send location information to the server when the user reports symptoms which would need approval but most people would agree to provide this if asked.

App set up failed. Retry

Hello I am trying to understand this statement

There are currently a couple of ways to do development with remote notifications:

./bin/pu.sh is a script forked from pu.sh. There are instructions there for obtaining credentials from an Apple Developer account. However, we are out of available APN keys, so you'll need to obtain that from another developer. Run the script with the path to one of the example notifications to send a remote notification through Apple: ./bin/pu.sh "Example Notifications/2_potential_diagnosis.apns. You will also need to set the following environment variables to configure the script:
TEAMID
KEYID
SECRET - the fully expanded path to the .p8 key.
BUNDLEID
DEVICETOKEN - retrieved from the console when running the application

I have found all the relevant values except for DEVICETOKEN - how do i find this please?

When do I run the pu.sh script and what does it do.

Otherwise I can build and run the app on my iPhone and iPad. However i am informed that the "App setup failed"
Does anybody have any comments on the above please?
Thank you
Ken

Use of the iOS 12 Provisional Notification API

Describe the bug/improvement
In terms of paths to onboarding for the app, many user often download an app and possibly launch once but never even finish setup.
In this event, without the user having authorised bluetooth access and notifications, the app will not work and will have no way to tell the user it's not working.

New launch flow
Steps:

  1. User downloads the app on an iPhone with iOS 12 or later (vast majority of devices)
  2. On first launch of the app , it triggers something like:
if #available(iOS 12.0, *) {
            UNUserNotificationCenter.current().requestAuthorization(options: [.provisional, .alert, .badge, .sound]) { (granted, error) in
            }
        }
  1. This will not trigger any notification authorisation dialogs initially
  2. The app then schedules a notification (which it can cancel if onboarding completes) which reminds the user to finish setting up the app to be safe
  3. Then even if the user quits before authorising full notifications, quiet notifications can still be displayed in the user's Notification Center and on the lock screen with the finish setup message

Docs
https://developer.apple.com/documentation/usernotifications/unauthorizationoptions/2993019-provisional
Smartphone (please complete the following information):
All devices running iOS 12 and later, >95% of active iOS devices

Android device supporting BLE receive only

Android devices may only support BLE receive, not broadcast. The current BLE data exchange protocol in the COVID-19 app will result in a "receive only Android device" recording the broadcast payload, but the other device will not detect or record the contact.

Steps to reproduce the behaviour

  1. Install app on Samsung J6 (supports BLE scan, connect but not broadcast)
  2. Install app on iPhone (supports both)
  3. Run app
  4. J6 should detect iPhone, but not the other way around

Expected behaviour
Both phones should detect each other to generate similar records on both phones, otherwise if the iPhone user becomes ill, the J6 user will not be notified. This is also necessary if there are any plans to switch to a decentralised model in the future.

Mitigations

  1. Add write-only characteristic to enable receive only devices to submit broadcast payload via data channel (preferred option that also enable decentralisation in the future).
  2. Infer symmetric contact records in central server. If the iPhone user becomes unwell and shares his/her contact records (not showing contacts with the J6), and the J6 user has already shared his/her records (showing contacts with the iPhone), the server can infer that the J6 should have been in contact with the iPhone (from the J6 records), and therefore notify the J6 user. This is a risky option, as the J6 user would not be notified if he/she has never submitted their records, i.e. they were never ill and therefore not notified.

Android bluetooth irrecoverable failure on too many open connections

Describe the bug
Bluetooth capability on Android device acting as peripheral enters irrecoverable failure state after circa 700 - 1000 connect requests without disconnect from central. Bluetooth on Android may still detect connection requests but stops accepting connection, service/characteristic discovery and characteristic read/write. There is no warning from Android. The device needs to be rebooted to recover. In the COVID-19 app, this means the Android device (peripheral) will appear operational but undetectable by centrals.

To Reproduce
Steps to reproduce the behaviour:

  1. Set one Android device (tested on Pixel 2) as peripheral, advertising a service and a readable or writable characteristic.
  2. Set another device (Android / iOS, tested on Samsung J6 Android) as central, scanning for the service, making a connection to the peripheral and writing or reading the characteristic.
  3. Repeat connect, read/write characteristic in a loop, without calling disconnect in each cycle.
  4. Peripheral will eventually stop accepting connections, or even if it accepts connections, read/write characteristic will fail.
  5. If step 3 is changed to include a disconnect after read/write characteristic, the cycle can run indefinitely and bluetooth will remain functional.

Expected behaviour
Peripheral should accept connect, read/write characteristics requests indefinitely, and remain robust against missing disconnect calls from centrals. This is a device / Android OS issue, but it has a direct impact on the COVID-19 app that relies on open connections and notifications for keep alive. It will mean some Android devices carried by people in high population areas will silently fail without warning, requiring device reboot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.