(I have tried to find the best suited iOS forum to ask this question, please advise me of the correct forum if it is misplaced.)
Our goal: To identify to which car infotainment system an iPhone is connected to. The identification mechanism is unimportant, but it needs to be consistent and the ID's need to be unique.
Our current situation: We are using AVAudioSession and currentRoute and its outputs to retrieve detailed information about the the current audio route. This works great as long as the phone is only connected to one single audio output port (the bluetooth infotainment system).
The problem: As soon as an USB cable is connected from the infotainment system to the iPhone lightning contact a new audio route and output is automatically selected. In the control center where you can control the audio output, it now says Dock Connector instead of the infotainment system. This changes currentRoute and therefore we cannot uniquely identify the vehicle (by using for example the MAC address).
Approaches we have looked at (in no particular order):
1. To disable the USB Audio output (dock connector). We cannot see that there is any way to do this programatically.
2. Using private API:s, such as BluetoothManager and MPAVRoutingController. Although, MPAVRoutingController was identified to only return information about AirPlay devices, maybe BluetoothManager would be a technically more viable solution. The problem is that our app needs to be in AppStore, and apps on AppStore is not allowed to use private API:s.
3. We have tried to use availableInputs on AVAudioSession to identify the connected infotainment system. Unfortunately, the only input found was the iPhone microphone, even if the phone was connected to an infotainment system.
4. We have looked at the possibility to join the MFi program and use the EAAccessoryManager and connectedAccessories. From our experience, we cannot identify all connected devices unless you are certified to communicate with every single device (infotainment system) on the market and also include supported external accessory protocol in the app's plist.
5. We have look at the predecessor of AVAudioSession called Audio Session Services. More particularly, we tried calling AudioSessionGetProperty with kAudioSessionProperty_AudioRouteDescription. But this essentially returns the same information as currentRoute in AVAudioSession.
6. We have looked at the possibility to find information, with the help of some API, about the device connected via USB cable. Unfortunately, we haven't found any.
Are all of the above approaches a dead-end? Has anyone succeeded in what we try to do (identify to which infotainment system the iPhone is connected to), maybe with a slight twist to one of the above approaches?