Xcode 14 & iOS 16 purple warnings starting with "[Security] This method should not .. "

Updated to Xcode 14.0 and built with iOS 16 device.

In purple it says "[Security] This method should not be called on the main thread as it may lead to UI unresponsiveness." A warning is displayed.

location is

@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {...

There is a part where it is difficult to know exactly which function it is because a warning is displayed at the location.

I also replaced the admob library with the latest version, but I have the same problem.

Does anyone know the cause of this issue?

I need help.

  • Can we please get an update from Apple? I'm not sure if this purple warning due to use of WKWebView.load should be ignored or not. I definitely don't want to ship my app with purple warning in it. Alternatively, I don't want to use SafariServices as it does not provide the desired experience for my users.

Add a Comment

Accepted Reply

This is the cause of this problem I have identified.

First of all, this problem occurs with apps that use the admob library.

Among the apps I sell, there is a paid app with a different target (same code) in the same project. When I build this paid app in my project, I don't see this warning.

My paid app uses "Other Swifts Flag" to not include the admob library in the code from the build generation, and the admob library is not included in the app.

I contacted Admob and got a reply.

Admob is also aware of this issue. Admob believes it's a bug by Apple, and Apple is also aware of this bug. Maybe it will be improved in the next Xcode or iOS update.

My guess is that when using WKWebView in Admob, you get such a warning message.

  • I do not use the Admob library, still have this warning when using WKWebView.

  • No only in adMob, I found this in Xcode 14.2 in my code:

    func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - in this function when return value over callback as: completionHandler(.useCredential, cred) in this block :)

Add a Comment

Replies

In my case the warning in AppDelegate comes and goes as it pleases (or should I say warnings since they could go up to 40 at a time), same with issue navigator, however I do get the warning in the console every single run. Caused by ads apparently.

  • Same here when using NativeAds.

Add a Comment