I have a BLE peripheral that requires a PIN code. I am connecting to this peripheral using Core Bluetooth CBCentralManager on iOS 7.
When I connect to this peripheral, 'didConnectPeripheral' (central delegate) gets called before the PIN code authentication is successfully completed.
iOS only displays the pin code dialog after 'didConnectPeripheral' is called.
I need to start interacting with the peripheral as soon as this PIN code dialog is finished and authentication process is complete. How can I determine when this has happened?
The challenge is to only proceed after the authentication is successful, but:
- iOS calls 'didFailToConnectPeripheral' prior to the dialog showing.
- iOS does not call 'didConnectPeripheral' again if the PIN code authorisation succeeded.
- iOS does not call 'didFailToConnectPeripheral' again if the PIN code authorisation failed.
From the above, I have been unable to determine:
- When the dialog completes.
- Whether the PIN code authorisation was successful.
Any help would be appreciated.