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

iOS background app to Android #1

Open
donothingloop opened this issue Apr 7, 2020 · 2 comments · Fixed by #2
Open

iOS background app to Android #1

donothingloop opened this issue Apr 7, 2020 · 2 comments · Fixed by #2
Assignees

Comments

@donothingloop
Copy link
Contributor

Thank you for the great project.

I noticed that you use the local name in the tracing of contacts with an iOS app that is in the background, and wondered whether this does actually work?

} else if (deviceName?.startsWith(NovidRepositoryImpl.BT_NAME_PREFIX) == true) {

According to the documentation of Core Bluetooth, the local name is not advertised when the app is running in background:
https://developer.apple.com/documentation/corebluetooth/cbperipheralmanager/1393252-startadvertising?language=objc

Maybe you could check whether the hash of the overflow area matches the UUID of the user ID service and then connect to the iOS device to check whether the service and characteristic really exists?
Here is at least some information about the overflow area:
https://stackoverflow.com/questions/29418388/ble-advertising-of-uuid-from-background-ios-app

If this already works and I simply did miss something here, please ignore this :)

@myfknoll myfknoll self-assigned this Apr 8, 2020
@myfknoll
Copy link
Member

myfknoll commented Apr 8, 2020

Thank you for your feedback.

Well, I fear that you may be right.
The funny thing is, that this code actually works: The Android device detects whether the device is on foreground or background. Unfortunately, the reason for that is, that the device name is somehow in the Bluetooth cache and the app obviously still receives the name of it.

I will definitely have a look into that, thanks!

@eldesouky fyi

@myfknoll myfknoll linked a pull request Apr 8, 2020 that will close this issue
@donothingloop
Copy link
Contributor Author

donothingloop commented Apr 8, 2020

I think that the fix will lead to various issues with other BLE devices that may not function correctly if a device is connected to them, it also may lead to a high battery usage.

Maybe you could do something like this?
#3

EDIT: from experience, when I walk around on the streets in Vienna, I see something like 50 new devices every 10 meters of walk appear, most of them are Win10 PCs (~60%) advertising but lots of IPhones (~35%). If you restrict this to iOS devices, this will at least limit the problem.

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

Successfully merging a pull request may close this issue.

2 participants