I need to continue the playback even when the user locks the phone. I've seen some solution over the internet, but none of them seem to work, such as:
AudioSessionSetActive(true);
// Set up audio session, to prevent iPhone from deep sleeping, while playing sounds
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty (
kAudioSessionProperty_AudioCategory,
sizeof (sessionCategory),
&sessionCategory
);
I'm inlcuding AVFoundation
, AudioToolbox
, and MediaPlayer
.