Our app's main feature is to play a list of audio tracks (local or progressively downloaded file-based audio files).
When a user selects a program, there will be an array of track objects (track id, description, url, etc). To start playback, we instantiate a new AVPlayer and set the track url to the player; when that track finishes (observe AVPlayerItemDidPlayToEndTimeNotification), we release the existing player, and then instantiate a new AVPlayer for the next track.
We have set AVAudioSessionCategoryPlayback when app launches.
We have set AVAudioSession active = YES when a new track is played.
We are using MPRemoteCommandCenter instead of the old beginReceivingRemoteControlEvents().
The implementation worked fine for many years. But starting from iOS 12.2, our users started experiencing some playback problems such as:
1. Failed to play the next track automatically.
-- from our logs, we can see that the player has started loading the next track, but then it was stopped (KVO, rate = 0)
2. The controls in Control Center were missing; it only showed "Music". It also seemed to affect AirPlay and Bluetooth (car).
We cannot always reproduce the problems so it is difficult for us to debug.
Then we commented out the lines of codes that load the banner request, and distributed a test version through TestFlight. Nearly 90% of the testers reported that they did not experience the problems again with the no-banner version.
Does a particular type of ad banner affect the behaviour of the Control Center? Do we need to set anything to prevent this?
Thanks.