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

Impossible to scan for Bluetooth devices on iOS when screen is off or app is in bacground. #320

Open
sc00n opened this issue Mar 14, 2023 · 2 comments
Assignees
Labels
documentation Improvement to documentation

Comments

@sc00n
Copy link
Contributor

sc00n commented Mar 14, 2023

According to iOS documentation and forums (e.g. https://developer.apple.com/forums/thread/652592), it is impossible to do a general Bluetooth scan when the screen is off or the app is in background. This will simply result in an empty scan. We also see this in our data. This probably should be added to the documentation of the carp_connectivity_package (https://pub.dev/packages/carp_connectivity_package).

It should however be possible to scan for specific devices when the screen is off. If I find the time, I can try to see if this can be done in flutter_blue_plus . Many researchers want to use the Bluetooth scan to test if a participant is near their partner. For this, a scan to specific device would suffice. (However, I don't expect to find enough time for a deep dive in the coming months :) )

@bardram bardram added the documentation Improvement to documentation label Apr 4, 2023
@bardram bardram self-assigned this Apr 4, 2023
@bardram
Copy link
Contributor

bardram commented Apr 4, 2023

Thanks, @sc00n. As a starter, I will incorporate this into the documentation.

If you come up with additional input, let me know.

@sc00n
Copy link
Contributor Author

sc00n commented Sep 21, 2023

After looking at this again, I think this is also true for Android (certainly for newer Android versions). So for both Android and iOS , the scan results return empty when the screen is off (most of the times in sensing I guess). This makes the ConnectivitySamplingPackage.BLUETOOTH sensor rather useless . In both Android and iOS it should however be possible to scan for the presence of a specific Bluetooth device, also when the screen is off and the app is in background.

--> there should be a new bluetooth sensor in the ConnectivitySamplingPackage that scans for a specific (set of) device(s).

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

No branches or pull requests

2 participants