Using AudioQueueServices to play a streaming MP3 file, the player stops when the app is switched to the background.
I have:
- On the "Background Modes" panel of the "Capabilities" project settings page, I've turned on "Audio, AirPlay and Picture in Picture" and "Background fetch"
On the "Info" page, under "Custom iOS Target Properties", added a "Required background modes" node with entries for "App plays audio or streams audio/video using AirPlay" and "App downloads content from the network"
In the initialisation code for the player module, I include the following call:
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &error];
which completes without signalling an error.
According to my logs, as soon as the app switches to the background, I stop receiving any callbacks, so playback stops almost immediately afterwards. What do I need to do to get it to continue?