关于进入后台音频需要持续播放的问题

  1. //Capabilities里面的backgroundModes, 把audio...选项勾选

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{}

或者- (void)applicationWillResignActive:(UIApplication *)application{}
添加以下代码即可

AVAudioSession *session = [AVAudioSession sharedInstance];
[session setActive:YES error:nil];
[session setCategory:AVAudioSessionCategoryPlayback error:nil];

你可能感兴趣的:(关于进入后台音频需要持续播放的问题)