I am new in this community. I need help solving a problem with Bluetooth in Objective-C. I want to discover all available bluetooth-devices and get information about an existing connection. (Not a scan for peripherals!) Is this possible in iOS? For example the list in Settings > Bluetooth!
Yes and no. It depends on your setup.
No, this is not possible using a public API.
Yes, it is technically possible with the BluetoothManager.framework
. My demo project BeeTee¹ shows how and encapsulate the underlying part.
However, based on the AppStore guideline §2.5 on private (undocumented) functions it is not possible to publish apps with the BeeTee and BluetoothManager.framework
in the AppStore.
If you decide to go with the BeeTee framework, you could easily list all Bluetooth devices in range:
class Demo: BeeTeeDelegate {
let beeTee = BeeTee()
init() {
beeTee.delegate = self
beeTee.enableBluetooth()
beeTee.startScanForDevices()
}
func receivedBeeTeeNotification(notification: BeeTeeNotification) {
switch notification {
case .DeviceDiscovered:
for device in beeTee.availableDevices {
print(device)
}
default:
print(notification)
}
}
}
If you are using iOS 11, please consider also the pull request #16. Unfortunately, I am too busy at the moment to merge this pull request yet.
¹ I am the author of BeeTee. :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With