Re: Background CoreBluetooth
Re: Background CoreBluetooth
- Subject: Re: Background CoreBluetooth
- From: Nick Brook via Bluetooth-dev <email@hidden>
- Date: Fri, 8 May 2020 00:47:51 +0100
If the app is quit or phone restarted I don’t think Android can wake up the
App, the user has to open the app again. Another iOS device with the app in
foreground wasn’t waking it up anyway. But I could be wrong!
I think iOS will terminate the process eventually despite the keep alive pings.
But then it may rediscover the other device in the background and reconnect
again. As it is only happening every 8s it probably won’t hurt battery life too
much, iOS is probably pretty good at managing the connection interval to keep
power consumption as low as possible.
I created a bug report for the Android issue as I think it could be fixed
(https://github.com/nhsx/COVID-19-app-Android-BETA/issues/10)
Nick
W: https://nrbtech.io
> On 8 May 2020, at 00:25, Darren Jones <email@hidden> wrote:
>
> Thanks for the write up. Your findings are pretty much the same as mine.
>
> I wonder how long the ‘keep alive’ can last. Possibly forever?
> If you are in a household with multiple iOS users that install the app, an
> initial connection could stay connected constantly while in range. I wonder
> what effect that would have on battery life.
> They’ve been very clever with the way Android can wake up iOS, so in a
> crowded area with many devices there’s a good chance the app will work.
> Walking to a local shop on your own and bumping into a few people, there’s a
> good chance it won’t.
>
>
> Sent from my iPhone
>
>>> On 8 May 2020, at 00:09, Nick Brook <email@hidden> wrote:
>>>
>> 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)
>> 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
>>
>> 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
>>
>>
>>> 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
>>>>
>>>>
>>>> On Thu, May 7, 2020 at 3:48 PM Darren Jones via Bluetooth-dev
>>>> <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)
>>>> 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
>>
_______________________________________________
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