Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CoreBluetooth XPC Connection Invalid on dismiss viewcontroller

After I have finished disconnecting from my bluetooth devices, seeing that they have disconnected in the didDisconnectPeripheral delegate, I attempt to dismiss my viewcontroller.

When this happens I see the message: "[CoreBlueooth] XPC Connection Invalid"

Is there something in specific that has to be cleaned up with Bluetooth before the viewcontroller is dismissed?

like image 357
Lou_257 Avatar asked May 09 '17 21:05

Lou_257


2 Answers

I placed CBCentralManager to a singleton and the error message is solved.

(CBCentralManager will not be deallocated)

like image 105
oOEric Avatar answered Sep 18 '22 16:09

oOEric


I was getting the following message:

[CoreBlueooth] XPC Connection Invalid

And I wasn't able to scan BLE devices using a quite simple implementation of the following:

NSObject<CBCentralManagerDelegate, CBPeripheralDelegate>

The solution for me was to add a value in my Info.plist for Privacy - Bluetooth Peripheral Usage Description NSBluetoothPeripheralUsageDescription describing what I do with Bluetooth Peripheral.

Looks like this in info.plist:

<key>NSBluetoothPeripheralUsageDescription</key>
<string>Play with BLE Compatible devices<string>

Write something more accurate in here ;)

like image 26
GabLeRoux Avatar answered Sep 18 '22 16:09

GabLeRoux