This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52832 iOS Pairing/Bonding - iOS asked 'Pairing Request' If I tap 'cancel' then on a subsequent attempt iOS fails to prompt <-- herein lies the issue

Hi

When I try and pair my App with my NRF52832 Nordic device, iOS responds with a popup 'Bluetooth Pairing Request'. If I tap 'Pair' here, the app connects, and all is well.

Unfortunately, failing to respond to this iOS-generated popup is the equivalent of tapping its 'cancel' button, and there is no way to adjust the amount of time that it stays on-screen.

The above would not be an issue if trying to pair a second time worked, but unfortunately, iOS appears to 'remember' the cancellation last time, and refuses to connect to the supplied BLE MAC address on the peripheral (which has not changed) on the second attempt. Basically, ConnectToKnownDevice(....) does not result in a DeviceConnected callback.

If I restart the App on the iPhone, normal operation is resumed, and I can pair successfully.

iOS appears to be caching the previous pairing rejection and not allowing the same device to pair, has anyone else experienced this and do you happen to know if there is anything I can do to prevent this behaviour.

On android there is no issue, on the iOS using the nordic NRFConnect app, there is also no issue (I can re-pair), I am thinking that this is using a trick or two on the CoreBluetooth libraries to have iOS ask 'Bluetooth Pairing Request' again on a subsequent connection attempt even if the 1st one failed?

Has anyone else experienced this?

Nigel

Parents
  • Hi Nigel,

    I asked one of our iOS developers if they have had this problem, but they hadn't seen it before. Have you tried to enable then disable flight mode to see if it has the same effect as rebooting the phone? This is a known trick to clear cached attribute tables.

    Best regards,

    Vidar 

  • Hi

    I don't have to reboot the phone, only to restart my app, then it pairs just fine. There must be a wee 'trick' on iOS to have it ask to 'pair' every time, even if a previous pairing request was rejected by the user, but I dont know what this might be!

    Flicking in/out of flight mode unfortunately does not resolve.

    If I use open characteristics then iOS does not ask to pair, my work around could be to do this and add application level encryption.

    Nigel

Reply
  • Hi

    I don't have to reboot the phone, only to restart my app, then it pairs just fine. There must be a wee 'trick' on iOS to have it ask to 'pair' every time, even if a previous pairing request was rejected by the user, but I dont know what this might be!

    Flicking in/out of flight mode unfortunately does not resolve.

    If I use open characteristics then iOS does not ask to pair, my work around could be to do this and add application level encryption.

    Nigel

Children
Related