First sorry for my English because I'm French.
I work on a connected object which send data to my app to start, pause, start the next music or the precedent and to augment the volume.
My application has to execute these actions on any music emitted by the iPhone. For example, if I listen to music in Spotify or Deezer, the app has to control it.
I don't know how I can do this in Swift. Just I really think that work with AVAudioSession
.