我有一个应用程序,它使用 WkWebView播放来自 Soundcloud 的音频,在 ios13beta6上,当应用程序不在前台时,音频就会停止, 甚至当 音频在 背景模式中打开时。
当开始播放时,这个断言被抛出:
Error acquiring assertion: <NSError: 0x282cf67c0; domain: RBSAssertionErrorDomain; code: 2; reason: "Required client entitlement is missing"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x1592432e0; requestedReason: MediaPlayback; reason: MediaPlayback; flags: PreventTaskSuspend | PreventTaskThrottleDown | WantsForegroundResourcePriority>;
}
进入后台状态后,抛出以下断言并挂起音频:
Can't end BackgroundTask: no background task exists with identifier 13 (0xd), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.
[ProcessSuspension] Background task expired while holding WebKit ProcessAssertion (isMainThread? 1).
在 iOS12系统中,音频在背景中正常播放,但这种情况并没有发生。