As far as I understand your question, you need to monitor for the presence of a Bluetooth audio device. Several times I did some research, and the result did not really satisfy me. Here is my conclusion:
1.) CoreBluetooth is for use only with Bluetooth 4.0 / Bluetooth Low Energy devices. Many Bluetooth headsets or even car radios are still not Bluetooth 4.x. Thus, if you cannot rely on your Bluetooth audio device, which should be 4.x, CoreBluetooth can be a waste of time.
2.) Your application will not be notified when an audio device is connected when your application is in the background.
Nothing good so far. But there may be some approaches that may help.
1.) Using the CLLocationManager, you can start monitoring, for example. a compass (not a place to save battery) to receive a notification when the phone has been moved. Just check the connected audio devices when the application calls CLLocationManagerDelegate. This, of course, is not very effective, but it may work.
2.) Use iBeacons and CLBeaconRegions, if available. Put the iBeacon in the custom car and start watching the lighthouse.
I know this is not exactly what you want to hear, but I am afraid that there is no direct solution to your problem.
amuses Peter
source share