iOS 13 - WkWebView BUG: audio stops when in background

I've an app that uses WkWebView to play audio from Soundcloud and Mixcloud by using their javascript widget, on iOS 13 Beta 6 the audio stops when the app is not in foreground, even when Audio is on in Background Modes.


When starting the playback this assertions is thrown:


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>;
}


And after entering background state the following assertion is thrown and audio suspended:


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).


This is not happening in iOS 12, where the audio plays normally when in background.

I have the same problem and after a week searching couldn't find any solution for it.

I have the same problem.

I have the same problem.


But Safari does not have this problem. Can somebody from Apple enginiers to help us?


Also, there is the similar question on SO -

https://stackoverflow.com/questions/57526699/ios-13-wkwebview-audio-stops-when-in-background


https://openradar.appspot.com/radar?id=5022510114406400

I too facing the same problem

wkwebview, audio stops when in background, but working in simulator

Reports are starting to roll in, from users of our app who upgraded to iOS 13, as well.

I am facing the same issue. Is this done on purpose to block webapp from running background audio?

same problem

I have the same problem.

I'm facing with the same issue, on iOs 13.1.2.

Same problem here, webapp audio is broken on iOS 13.

Still searching for a workaround...

Same issue, when I was using version 12+ was working perfect, as soon as the version 13.1.2 was release this issue started happening, the only work around I have found so far is keeping the screen on all the time.

Same error here trying to play local html audio in a cordova app. Plays in Simulator not on device. Even in foreground.

Upping the topic.


There is still an issue in iOS 13, the sound get paused automatically after few moment..., did anyone find a workaround?

Unfortunately, from iOS 13 this ability is under sytem entitlements, com.apple.multitasking.systemappassertions and com.apple.multitasking.unlimitedassertions, you can try it in simulator, no error in log. There is no way to launch it on device thought, as you need an Apple issued provision profile. So, all we can do is to hope that some future release will fix this.

I have the same issue

I am also encountering this issue after upgrading to iOS 13.2.

I have the same problem.

I have the same problem.

Yes, same problem here, though the app is in foreground and audio doesn´t work at all.

EDIT: I just noticed that this is in regards to Cocoa Touch. I don´t use Cocoa Touch but I do use wkwebview.


iPadOS 13.2.2

Same issue here, using wkwebview-cordova plugin. WebAudio stops when iOS 13 app is put into background, and never comes back when app is restored. Subsequent calls to the audioContext don't produce any sound, despite seeming to work. (I know they seem to work because the program knows how long the individual files are, which affects elements in my UI.)


Creating a new audioContext after 'focus' doesn't work either.

https://bugs.webkit.org/show_bug.cgi?id=20426


Leaving this here for reference

Same issue here, has anyone had any luck with this yet? Complaints are rolling in...

Does anypne manage to fix this. i'm having the same problem.

Same problem here

Same issue on iOS 13.3.1. Is a fix coming anytime soon?

iOS 13 - WkWebView BUG: audio stops when in background
 
 
Q