react-native-webview: "UI unresponsiveness" warning on @main - Xcode 14

Bug description:

I’m seeing a runtime error in Xcode 14 that says [Security] This method should not be called on the main thread as it may lead to UI unresponsiveness. and my webview doesn’t want to display the external page even though I have specified the permissions.

info.plist

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>myawesomedomain.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

I’ve searched everywhere and nobody has the answer. Except it might be better to use WKWebView or use Xcode 13. I’m a bit lost… The same version of the code works perfectly for Android.

Environment:

  • OS: MacOS
  • OS version: 13
  • react-native version: 0.70.5
  • react-native-webview version: 11.26.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 17

Most upvoted comments

@Dany128 As I posted above, the warning is a known issue on Apple’s end and I don’t think there’s anything you can do but ignore it.

It’s also opening a video screen, when the site doesn’t have a video.

Just a guess, but the sites in your video do have autoplaying video ads. They might be related to the opening of the video screen…??

@aleciosouza Thank you for the expanded thread stack trace. That allowed me to find that this is a common warning with WKWebView on XCode 14, and is a known issue on Apple’s side: https://developer.apple.com/forums/thread/714467?answerId=734799022#734799022

Doesn’t sound like there’s anything that you or react-native-webview can do about it.