let filter = NSPredicate(format: "self == %@", name)
DispatchQueue.main.sync {
EAAccessoryManager.shared().showBluetoothAccessoryPicker(withNameFilter: filter) {[weak self] error in
guard let self = self else { return }
if let error = error {
switch error {
case EABluetoothAccessoryPickerError.resultCancelled:
break
case EABluetoothAccessoryPickerError.alreadyConnected:
break
case EABluetoothAccessoryPickerError.resultFailed:
break
case EABluetoothAccessoryPickerError.resultNotFound:
break
default:
break
}
return
}
}
}
The first call works fine. If you try to reconnect after disconnecting the Bluetooth connection, the following error appears and the Picker is not visible. The switch statement that handles errors also doesn't work at all.
[lifecycle] [u 2E51A6AB-2B5A-4E51-AF42-354CC66454BC:m (null)] [com.apple.CoreBluetoothUI.BTDevicePickerUI(1.0)] Connection to plugin interrupted while in use. [lifecycle] [u 2E51A6AB-2B5A-4E51-AF42-354CC66454BC:m (null)] [com.apple.CoreBluetoothUI.BTDevicePickerUI(1.0)] Connection to plugin invalidated while in use.
Is there any way to solve it?