I have an application built with .NET MAUI that uses the CoreBluetooth API to scan for our devices. As we need extanded advertisings we want to check if the device supports it. Our problem is that the query by using the "supports" method of CBCentralManger with argument "extendedScanAndConnect" gives us not always the same result.
- When called at the app start we get false (=> not supported)
- When called when the state of CBCentralManager changes to "poweredOn" we get false (=> not supported)
- When called later when a button to scan is pressed we get true (=> supported)
How can we get the information if extended scan is supported at startup of our app?
Hardware: iPhone 14 OS: iOS 18.0.1
You are indeed getting the information you seek at start of your app. While the answer may not be what you would like to see, it is the answer for the availability of this feature.
Supported features is available to the CBCentralManager, a trivial but non-zero amount of time AFTER the power state changes to poweredOn. So if the app tries to read this immediately after the power state change, it will always get FALSE.
The recommendation is to check for the state as late in your app as possible at the point where you are going to start scanning.
Argun Tekant / DTS Engineer / Core Technologies