Question

I have got a cycle timer app which plays short sounds at the end and start of each round (round is 2/3 mins, rest is 30/60 secs). All that works fine while in the foreground, but works only for some minutes in the background. I have added background mode, but it doesn't help. So how can i make it work? :) Should i use AVAudioPlayer or AudioServicesPlaySystemSound? UPD: here is an app makes what I want: https://itunes.apple.com/ru/app/boxing-itimer/id506058665?mt=8

Was it helpful?

Solution

I have found the solution myself, thanks everybody tryed to help me ;) To play the sound in the background more then once you have to use AVAudioPlayer add audio as a supported backgroundmode and add this method to - (void)viewDidLoad

[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top