How do I start playing audio when in silent mode & locked in iOS 6?

You need to make couple of changes in plist file.

i.e. 1) Set Required background mode to App plays audio

2) set Application does not run in background to YES.

 NSError *setCategoryErr = nil;
    NSError *activationErr  = nil;
    [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error:&setCategoryErr];
    [[AVAudioSession sharedInstance] setActive:YES error:&activationErr];

Then, you need to write these much code in AppDelege

Now, you can easily run audio while phone screen locks or in background.

Leave a Comment