Re: Background CoreBluetooth
Re: Background CoreBluetooth
- Subject: Re: Background CoreBluetooth
- From: Nick Brook via Bluetooth-dev <email@hidden>
- Date: Fri, 8 May 2020 00:09:03 +0100
I’ve been playing around with this today, testing with my own code and looking
at the NHS App.
The NHS App is doing nothing special, as far as I can see
It advertises a service, and in the background iOS puts the service in the
“overflow” (one-hot encoded
<https://crownstone.rocks/2018/06/27/ios-advertisements-in-the-background>)
Android looks for this specific one hot encoded value. Actually, it doesn’t
look for a specific bit set, but a fixed set of bytes, so if other Apps are
advertising services in the background on iOS the NHS App on Android might fail
to discover it. This seems like a bug, although I’m not sure if they could work
around it
It attempts to keep connections (and the process) alive for as long as possible
by sending “keep alive” data every 8s (under the 10s execution window apple
provides)
It is susceptible to the problems other Apps are (restarting the phone,
quitting the app etc can break scanning and discovery) but it helps to overcome
this through notifications to the user to reopen the app.
I’m not sure if Apple imposes a time limit on scanning for/advertising services
in the background although presumably there is a notification for this in the
NHS App if it does.
With the user notifications, if users actually respond to them it might work
well enough to be effective. But I could see users ignoring the notifications
if there are too many, and particular when out and about and busy these may get
ignored. If they are ignored, the App may not work for a long period of time.
It seems the UK government may be reconsidering the centralised approach now
anyway:
https://www.telegraph.co.uk/news/2020/05/06/nhs-explores-feasibility-moving-contact-tracing-app-apple-google/?fbclid=IwAR2qT77qzPkMlefQWYRFKmy-zj3Y_z2-Ip2peuUE9nCdokHldxuEIC1Ze64
<https://www.telegraph.co.uk/news/2020/05/06/nhs-explores-feasibility-moving-contact-tracing-app-apple-google/?fbclid=IwAR2qT77qzPkMlefQWYRFKmy-zj3Y_z2-Ip2peuUE9nCdokHldxuEIC1Ze64>
I’d be keen to hear any further insight into how the App is working or
background bluetooth can made to work better.
Nick Brook
NRB Tech
W: https://nrbtech.io <https://nrbtech.io/>
> On 7 May 2020, at 21:17, Darren Jones via Bluetooth-dev
> <email@hidden> wrote:
>
> There is no location permission in the app.
> Which is a good job as the questions over privacy would explode more than
> they already have.
>
> Sent from my iPhone
>
>> On 7 May 2020, at 21:14, Diego Alfarache <email@hidden> wrote:
>>
>>
>> These apps are going to have background location permission, which
>> effectively gives them free reign to run almost anything in the background.
>>
>> I created a framework for a client that would act as both a peripheral and
>> central while executing in the background, but only when they had “always”
>> location permission.
>>
>> Diego
>>
>>
>>
>> From: "Jan Lübeck via Bluetooth-dev (Fyrastudio)"
>> <email@hidden>
>> Reply-To: "Jan Lübeck (Fyrastudio)" <email@hidden>
>> Date: Thursday, May 7, 2020 at 3:04 PM
>> To: Darren Jones <email@hidden>
>> Cc: <email@hidden>
>> Subject: Re: Background CoreBluetooth
>>
>> Apple did announce that they are sharing their APIs with specific
>> developers. Maybe UK NHS is one of them?
>> ______
>> Jan Lübeck
>> Chief Technology Officer
>> fyrastudio.com <http://fyrastudio.com/>
>>
>>
>> On Thu, May 7, 2020 at 3:48 PM Darren Jones via Bluetooth-dev
>> <email@hidden <mailto:email@hidden>> wrote:
>> Unless you have your head buried in the sand, I’m sure everyone has noticed
>> the sagas going on with countries creating their own COVID-19 contact
>> tracing apps.
>>
>> I have personally tried many times over the years to create an app that can
>> broadcast and scan in the background to trigger a ‘contact trace’ and always
>> failed. Yet the UK NHS are claiming they have an app that does just that.
>>
>> I’d love to hear from anyone that’s had experience with background BT. Is it
>> possible? Can a background CBPeripheral be detected by a background
>> CBCentral?
>>
>> If not, is there a definitive time period when discovery becomes impossible?
>>
>> Thanks
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Bluetooth-dev mailing list (email@hidden
>> <mailto:email@hidden>)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden <mailto:email@hidden>
>> _______________________________________________ Do not post admin requests
>> to the list. They will be ignored. Bluetooth-dev mailing list
>> (email@hidden) Help/Unsubscribe/Update your Subscription:
>> This email sent to email@hidden
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Bluetooth-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden