In CBPeripheralManager, how to know if user push a

2019-08-07 13:05发布

问题:

I'm making BLE connection between iPhone and device with CBPeripheralManager.

If Central tried to pair with peripheral, Bluetooth pairing alertController pops up and user can choice which one there're going to use. Most of them will push a connect button.

But is there a way to know when user push a cancel button?

Delegate API would be good but I couldn't find it.

回答1:

I'm not sure, but maybe didFailToConnectPeripheral method of CBCentralManagerDelegate is a good place to handle your case.