iOS: "Forget" bluetooth peripheral programmatically

Hello,


I'm using Core Bluetooth to "pair" with a bluetooth peripheral (encrypted connection). Currently, it seems like the only way to "forget" or unpair the bluetooth peripheral after successfully pairing with it is through Settings > Bluetooth > "Device Name" > Forget This Device.


I've noticed that some apps (like this one: https://itunes.apple.com/us/app/elgato-smart-key/id674533376?mt=8), allow a user to forget a connected device programmatically through the app (and to my surprise the paired peripheral is also removed from the Settings app, even though it previously showed up there as well). Does anybody know how forgetting a paired device programmatically is possible?


Thanks!

Replies

I believe that if the peripheral breaks the bond iOS will remove it from the list of devices. Similar to the way you cannot control the connection interval for Core Bluetooth, but if you control the peripheral and can tell it to ask iOS for a different connection interval iOS will usually honor that request.


So my guess would be that Elgato is asking the periphal to kill the pairing, and which then does so, and iOS response by removing the device.

Thanks for the response,


I've tried doing this, but although the peripheral erases its bonding data, that doesn't affect the banding informtion in the Settings app. Do you know of any other actions the peripheral can take other than just erasing the bonding data? As in, what message can the peripheral send to the core OS to tell it to also forget it's bonding data?

Hello,


Any other suggestion on how to forget a device programmatically?


I'm facing a similar issue:: If the device is no more paired (it lost the LTK) but

the iPhone still holds its LTK, the connection does not complete.

how to detect that the device is no more paired but the iphone still has the LTK?


Thanks for your help

Has anybody find a way to remove the bondings programmatically or is this really not possible?

hello , i have met a same problem like you , do you have any idea to forget device from setting list ?

I found the following answer:

https://forums.developer.apple.com/message/135732#135732


Gualtier MaldeMay 3, 2016 8:07 PM(

in response to Operator)


Currently, the only way to unpair a Bluetooth accessory is by the user to manually "forget" it in Bluetooth Settings.


This is a security measure and there is no workaround for it. It prevents apps and other accessories from spoofing an existing accessory by unpairing and "re-pairing" themselves without the users' knowledge.