Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mguniverse

macrumors newbie
Original poster
Jan 24, 2010
7
0
This question also relates to ipad, but i assume it's the same. Does anyone know what I need to add to my app if I want audio to continue playing when the device is locked? This would be very helpful, so answer as soon as possible.

Also I don't mean background audio from iphone 4.0, just how to make it play when the iphone is LOCKED.

I know the pandora app does this.
 
Just make sure you're using the right Audio Session Category. By default AVAudioSessionCategorySoloAmbient will be used. You want to use AVAudioSessionCategoryPlayback so the audio will not fade behind the lock screen.
 
Just make sure you're using the right Audio Session Category. By default AVAudioSessionCategorySoloAmbient will be used. You want to use AVAudioSessionCategoryPlayback so the audio will not fade behind the lock screen.

How do I do this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.