Is it possible to see if a phone is connected to a bluetooth headset or to another bluetooth device?

Is it possible for an app to see if a phone is currently connected to a bluetooth device? If so, is it possible to see what the device is?

For example, could an app determine if a phone is connected to a bluetooth headset or to a car audio system?

Replies

You'll want to use the EAAccessoryManager class in the ExternalAccessory Framework.


See Apple's API documentation here. It should be self-explanatory, like checking the value of:


var connectedAccessories: [EAAccessory] { get }


which "contains an array of

EAAccessory
objects. Each object corresponds to an accessory that is connected and available for your application to use. Because the contents of this property can change dynamically based on the connection and disconnection of accessories, you should not cache the value of this property."