I'm trying to use AVAudioSession and AVAudioPlayer and audio background mode to keep my app active in background. It works fine if no interruptions arrives. But, when I received audioPlayerBeginInterruption message I launch a backgroundTask and wait for audioPlayerEndInterruption message, and then relaunch my audio session.
(I noticed that after audioPlayerBeginInterruption apps is still active, player is just paused, but after audioPlayerEndInterruption apps become suspended)
Problem 1 : If the audioPlayerEndInterruption message arrive after 10 minutes, background task is killed and application become suspended, and I Can't restart my audio session
Problem 2 : For several apps/games, I received audioPlayerBeginInterruption message but I never received audioPlayerEndInterruption.
How can I get my application always active ?
Thanks for all your answer and advice