Hi,
I have implemented a custom audio streaming protocol in my iOS app using AVCustomRoutingController to select my custom device. Playback and streaming works. However when the app is the background, it gets killed in a couple of seconds, like if it was not playing audio.
My app has the Audio/AirPlay/PIP background mode and can play audio from the background when the route is a normal AVRoute from the system (Speaker/AirPlay/Bluetooth, etc).
I tried starting an AVAudioSession (playback category, activated, with and without MPRemoteCommandCenter bindings and with and without populating NowPlayingInfoCenter) was hoping that if that is active, my app won't be killed. But it seems like it does get killed if the app is not producing audio using AudioOutputUnit/AVAudioEngine/AVPlayer.
How does one supposed to stream audio from an app in the background using a custom protocol?
The infamous "let's play silence to not get killed" solution works, but obviously that can't be the answer.