Is there a way to get the AirPlay device type the iPhone is connected to? For instance, is there a way to know that the iPhone is connected to a HomePod, an Apple TV, or AirPods via AirPlay? I would like to show an icon in my app for which device the iPhone is connected to (I provide the icons). I have somewhat achieved this using
let currentRoute = AVAudioSession.sharedInstance().currentRoute
let output = currentRoute.outputs.first!
let portType = output.portType
but AVAudioSession.Port only contains the type airPlay
(see link for all property types). It does not contain something like homepod
, appleTV
, .airpods
, etc. Does anyone have a work around for this or any ideas?