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

Bluetooth Permissions Modal shows prematurely #504

Open
twyatt opened this issue Jun 15, 2023 · 6 comments
Open

Bluetooth Permissions Modal shows prematurely #504

twyatt opened this issue Jun 15, 2023 · 6 comments
Labels

Comments

@twyatt
Copy link
Member

twyatt commented Jun 15, 2023

Reported internally:

Current behavior: BLE permissions pop up shows up on initial app start
Expected behavior: BLE permissions pop up appears at appropriate point in pairing flow

I've tracked the issue down to CBCentralManager initialization in Kable in the CentralManager class. It seems that initialization–itself–is enough to trigger the prompt. I deleted all usages of the local cbCentralManager and did not provide a delegate in the init, so it doesn't happen when the manager is used–happens right when it's init'd. What's weird is that this isn't the behavior in iOS. I can initialize a CBManager natively without being prompted.

@twyatt twyatt added the apple label Jun 15, 2023
@Phoenix7351
Copy link
Contributor

Was wondering what @twyatt and @davidtaylor-juul 's thoughts are on this? Based on my findings, a reasonable solution would be to find a way to defer the initialization, but I thought there might be something I'm missing? Or maybe a better solution?

@davidtaylor-juul
Copy link
Contributor

I think we should investigate further the discrepancy between natively initializing (and no prompt) vs initializing in this library and having an immediate prompt.

@twyatt
Copy link
Member Author

twyatt commented Jun 24, 2023

@Phoenix7351 it'd be great to get a sample iOS app in the SensorTag sample app (it has been requested); if you have the time/bandwidth?

With iOS support in the SensorTag sample, then it would give me a nice simple repro to be able to easily investigate this issue.

@Phoenix7351
Copy link
Contributor

@Phoenix7351 it'd be great to get a sample iOS app in the SensorTag sample app (it has been requested); if you have the time/bandwidth?

With iOS support in the SensorTag sample, then it would give me a nice simple repro to be able to easily investigate this issue.

Agreed, but, yeah, really don't have the bandwidth for it at the moment. It might be helpful to checkout my CA-2008 branch? I did a lot in there to stub out things to eliminate them as potential causers of this issue. In that branch you can bring in/comment out the CBCentralManager to replicate the behavior. That might be helpful to start?

@Phoenix7351
Copy link
Contributor

It just occurred to me that the issue is probably not having the iOS app side setup. I can help you with that!

@Phoenix7351
Copy link
Contributor

https://medium.com/@adrianwitaszak/kotlin-multiplatform-mobile-bluetooth-permission-and-bluetooth-service-setting-9a697e70700

This article makes no mention of this behavior, but also instantiates CBCentralManager lazily.

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

No branches or pull requests

3 participants