iOS 13 - WkWebView BUG: audio stops when in background

Originator:Andrey.Sikerin
Number:rdar://5022510114406400 Date Originated:
Status: Resolved:
Product:ios Product Version:ios 13
Classification:Bug Reproducible:yes
 
I've an app that uses WkWebView to play audio from Soundcloud and Mixcloud by using their javascript widget, on iOS 13.1 (13.0) 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.


https://forums.developer.apple.com/thread/121822

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!