[英]Device plays audio in background, Simulator does not
Here's the issue: 这是问题所在:
I have done the following: 我已经完成以下工作:
.plist
background mode is audio
. .plist
背景模式为audio
。 didFinishLaunchingWithOptions
didFinishLaunchingWithOptions
调用以下代码 [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error];
[[AVAudioSession sharedInstance] setActive:YES error:&error];
What am I missing? 我想念什么? I checked that
error
is nil
after both methods. 两种方法后,我都检查
error
nil
。
I'm quite sure the simulator doesn't support background audio, unfortunately. 不幸的是,我非常确定模拟器不支持背景音频。 You'll have to resort to testing on real devices.
您将不得不在真实设备上进行测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.