1

I need my application audio to still run even though it goes into the background with device music audio. I try the codes suggestion in this page but my application still doesn't work.

enter image description here

  1. Set Required background mode to App plays audio
  2. Set Application does not run in background to YES

AppDelegate.m

NSError *setCategoryErr = nil;
NSError *activationErr  = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error:&setCategoryErr];
[[AVAudioSession sharedInstance] setActive:YES error:&activationErr];
Community
  • 1
  • 1
shoujo_sm
  • 3,173
  • 4
  • 37
  • 60

1 Answers1

0

Here you can find a related question about it.

How to handle background audio playing while iOS device is locked or on another application?

I would suggest you to take a look a this tutorial:

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_background-audio/

It explains all the different steps to follow.

Community
  • 1
  • 1
Manuel Escrig
  • 2,825
  • 1
  • 27
  • 36