Xamarin iOS External Accessory: check whether hands free device (car) is available

488 Views Asked by At

I want my app to detect the Hands-Free built in the car. I don't need to communicate with the device, I just need to check if it is available.

Ex: I want to send a notification when an Hands-Free is available on the vehicle.

I got this working with CoreBluetooth but it only works with BT4/BLE. Do I need to use EAAccessoryManager for old Bluetooth devices (version 2.0)? How can I implement this? I did try the code below but does not work:

var _accessoryList = EAAccessoryManager.SharedAccessoryManager.ConnectedAccessories;

foreach (EAAccessory acc in _accessoryList)
{
    // devices
}

The list _accessoryList is always empty.

The info.plist contains the background mode External accessory communication and the key UISupportedExternalAccessoryProtocols which I am not sure what should be the value to put in.

Any help? what am I missing? Thanks

0

There are 0 best solutions below