I've been searching how to start an audio file after a couple of seconds when the app enters background, and it's working, but there's a small issue I'd love to get rid of.
Without the following code, the AVAudioPlayer won't begin playing:
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
But with this code, notification center starts acting like a remote.
I've seen (alarm) apps play a sound after some time, without notification center acting like a remote.
Any suggestions?
You can find the example code here: https://github.com/SabatinoMasala/iPhone-background-audio