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 Advertisement isConnectable always null #697

Closed
R4leven opened this issue Jun 20, 2024 · 3 comments · Fixed by #700
Closed

iOS Advertisement isConnectable always null #697

R4leven opened this issue Jun 20, 2024 · 3 comments · Fixed by #700
Labels
apple bug Something isn't working

Comments

@R4leven
Copy link

R4leven commented Jun 20, 2024

Hi,

We want to filter out non-connectable BLE devices based on some conditions and are using the isConnectable flag on the Advertisement.

The flag works on Android, but on iOS it is always null, even for connectable devices.

Maybe the cast of the CBAdvertisementDataIsConnectable value to Boolean is not working correctly.

I tested it without KMP and a CBCentralManager on iOS and the value was set to 1.
Perhaps the value needs to be cast to NSNumber (which is stated here: https://developer.apple.com/documentation/corebluetooth/cbadvertisementdataisconnectable) and then the boolValue needs to be used.

image

using com.juul.kable:core:0.31.1 and iOS 17.5.1

@R4leven R4leven changed the title iOS Advertisement always null iOS Advertisement isConnectable always null Jun 20, 2024
@twyatt
Copy link
Member

twyatt commented Jun 20, 2024

Aw yes, that looks like a bug. Thanks for the thorough analysis of the issue! I'll get a fix up soon.

@twyatt
Copy link
Member

twyatt commented Jun 21, 2024

@R4leven let me know if you need me to back port the fix to Kable 0.32.x (i.e. if you're not ready for Kable 0.33.x w/ K2 upgrade yet).

@R4leven
Copy link
Author

R4leven commented Jun 21, 2024

Thank you for the quick reply and fix. We are planning on upgrading to 0.33.x soon, so no back port is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apple bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants