I’ve seen this asked several times for Android, but never iOS. Is there any way to enumerate the currently-connected Bluetooth devices, or if not, to test for a specific one? We’re trying to build an app that can detect when it loses connectivity with a particular audio device.
For the record, it doesn’t need to actually do anything with the device. It just needs to know if it’s connected or not.
Another less-helpful way way would be if we can detect which is the currently-selected audio output. The only down-side is technically you can be connected to it and still route the audio through something else (headphones, AirPlay, etc.) so it’s not really giving us what we want, but it’s better than nothing (if this is possible.)
As of iOS 5.0 you can use the CoreBluetooth framework. Have a look at the CBCentralManager class. This class lets you retrieve a list of connected devices.