I want to remove paired bluetooth device from system settings or "unpair". I know that apple doesn't provide public api to do this so I tried private class CBPairingAgent
. I found headers on github
CBCentralManager.h
CBPairingAgent.h and here is my code:
- (void)unpair:(CBPeripheral *)peer {
id agent = [self.centralManager valueForKey:@"sharedPairingAgent"];
// [agent performSelector:@selector(setDelegate:) withObject:self.centralManager];
[agent performSelector:@selector(unpairPeer:) withObject:peer];
}
This code runs without errors but also without any effect for peripheral.
Can somebody point me in right direction? Or suggest better way