Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background scan stops #18

Open
mash opened this issue Apr 21, 2020 · 3 comments
Open

Background scan stops #18

mash opened this issue Apr 21, 2020 · 3 comments

Comments

@mash
Copy link

mash commented Apr 21, 2020

This is a theoretical issue, I haven't tested this but should happen.

Here you're trying to periodically start and stop scanning.
https://github.com/opentrace-community/opentrace-ios/blob/master/OpenTrace/Bluetrace/CentralController.swift#L103

When the app goes background, right after stopScan is called, background scanning will not work.

See https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html#//apple_ref/doc/uid/TP40013257-CH7-SW9

The services the central manager was scanning for (and any scan options specified when the scan started)

Was this, scanning start/stop dance proved to be effective ?
As I understand iOS can be scanning and advertising at the same time without a problem.

@erwanmace
Copy link

@mash you may want to check this other issue #4

@wabzqem
Copy link

wabzqem commented May 13, 2020

I have confirmed that this happens with the COVIDSafe application using this code:
https://docs.google.com/document/d/1sviVey1jCk97BACwkAJMctG8rFlC7Mf8pMpluW6VOQw/preview

This could definitely work much better.

@mash
Copy link
Author

mash commented May 15, 2020

Agree. I tried the background task approach that was proposed in #4, and it worked. I think that's the max we can get out of the current iOS. I'll update my own repo https://github.com/mash/BLE-Proximity with my findings. There seems no activity here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants