So I am working on an app that requires different audio files to be played using an NSTimer every X amount of time. Yes, it needs to play the audio in the background as well, but I have had inconsistent results trying to do so. I have searched the web thoroughly to find a solution to this problem, but I have had no luck.I have enabled background modes and checked off item 0(audio) and made sure it was in my info.plist. I have set the App does not run in background key to NO in the info.plist. In the viewDidLoad method of the VC, I have set the AVAudioCategory to categoryPlayback and set the AVAudioSession to active. I have also moved these lines of code around in different places of the app to look for different results, and the best results I have gotten is that the app will continue to run in the background sometimes and at other times it will suspend.Through all of my searching, I have seen forums explaining how to play audio in the background. However, I have not found
3
0
1.9k