iosswiftxcodeswiftuiwebview

Warning prints in console when using WebKit to load YouTube video


I am using WebKit and a WKWebView to load a YouTube video into my SwiftUI application. Whenever the YouTube video plays or pauses I get this message printed in the console as a warning. I think it is due to a lack of permissions or capabilities added to my app.

Another SO thread said to add the BackGround Modes capability and check the background fetch and background processing boxes. I did so and I still get this message. How can I clear this warning?

ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Suspended Assertion' for process with PID=12858, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}*


Solution

  • Just add this to your webview:

    webView.allowsLinkPreview = true