Bluetooth Low Energy advertising to be discoverabl

2019-03-06 11:10发布

问题:

I have an iOS app which is using CBPeripheralManager to implement a peripheral. I start advertising with the command:

 [self.peripheralManager startAdvertising:@{CBAdvertisementDataLocalNameKey : @"MY_DEVICE_NAME"}];

According to the Apple docuentation, https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/index.html#//apple_ref/occ/instm/CBPeripheralManager/startAdvertising:

only two of the keys are supported for peripheral manager objects: CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey

My issue is that I want this peripheral to be discoverable in the Settings -> Bluetooth area of iOS settings. At present it is only discoverable via an app and the CBCentralManager scanForPeripheralsWithServices API call. Do I need to add a data service to make it discoverable via iOS settings ?

回答1:

Bluetooth Low Energy devices are not discoverable in the Settings->Bluetooth page. This is only for Bluetooth 2.1/3.0 devices such as keyboards and headsets/handsfree devices.

A Bluetooth Low Energy peripheral is only discoverable by an app using Core Bluetooth.