Question

We have a bondable (when we connect we are asked to Pair, see question 2) Bluetooth 4.0 peripheral that we have manufactured and have written an iOS app for.

Question 1

Is it possible in iOS 6 with CoreBluetooth to remove our peripheral from the iOS Bluetooth Settings from within our app or is this restricted to only going to iOS Settings / Bluetooth / Our Peripheral and "Forget this device".

What we are trying to do is when we remove our peripheral from within our app, we expect this peripheral to be removed from the iOS Bluetooth list as well.

Question 2

My second question is, does iOS SDK provide a way to determine if a user has chosen "Pair" or "Cancel" on the Pairing request alert? As of now, we determine the user pressed pair by reading our services / characteristics when the device is connected.

Pairing example

Was it helpful?

Solution

  • Question 1

No, I really dont think so. Clearing it through settings is the only possible way.

  • Question 2

The centralManager delegate has callbacks for both failed and successfully connected peripheral, so I would listen to them to check if user cancelled or not: didConnectPeripheral and didFailToConnectPeripheral

OTHER TIPS

When you click 'cancel' on the bonding dialog iOS will call the delegate method 'centralManagerDidUpdateState' with the state being 'CBCentralManagerResetting'. If you click pair then the command will proceed normally.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top