When calling CBCentralManager's connectPeripheral:options:
with some Bluetooth devices I'm getting the "Bluetooth Pairing Request" alert on iOS and a similar "Connection Request from:" alert on macOS. Is there a way to determine upfront if the alert is going to be presented or not? Alternatively is there a way to prohibit presenting this alert (in which case the connect request could fail, which is totally fine)? I tried specifying these options:
var manager: CBCentralManager
...
manager.connect(
peripheral,
options: [
CBConnectPeripheralOptionNotifyOnConnectionKey: false,
CBConnectPeripheralOptionNotifyOnDisconnectionKey: false,
CBConnectPeripheralOptionNotifyOnNotificationKey: false
]
)
but those didn't help (and by the doc they shouldn't help as they relate to the use case of app running in background, which is not applicable in my case – my app runs and calls connect when it is in foreground, the unwanted alert is displayed immediately).