WKWebView http & # 8594; https redirection for IOS 10 ATS Compliance

iOS 10 imposes https on us and completely violates the application I'm developing. The application is partly an RSS reader. The URLs we get from RSS feeds are often HTTP URLs for both sites and metadata images. These URLs are redirected to https when they are available only in safari and SFSafariViewController. However, when using WKWebView, this redirection does not occur. The OS simply blocks the download of non-https. If I try to crack the problem by replacing “http” with “https” in the URL, sites often break down when they load their images, CSS and JavaScript from the http CDN, and these requests are also blocked. How can I get the same behavior in WKWebView as in Safari? Is there any configuration I can install? It seems crazy to methat Apple will make this change and simply break customers using WKWebView.

PS Facebook can somehow get around this. I can’t say whether it is hacked heavily by the SFSafariViewController or whether they somehow did work on the Internet. Does anyone know how they did this?

+4
source share
4 answers

NSAllowsArbitraryLoads. - ; Apple , . . Apple ATS , , , NSAllowsArbitraryLoadsInWebContent . , , NSAllowsArbitraryLoads.

Apple ATS 2017 .

+3

Apple NSAllowsArbitraryLoadsInWebContent. WKWebView, http . , , .

0

NSAllowsArbitraryLoads ', , , , , Apple , .

, iOS 9, iOS 10, , NSAllowsArbitraryLoads, NSAllowsArbitraryLoadsInWebContent info.plist. iOS 9 NSAllowsArbitraryLoadsInWebContent, NSAllowsArbitraryLoads, iOS 9 .

iOS 10, NSAllowsArbitraryLoadsInWebContent'key, iOS NSAllowsArbitraryLoads, - . , iOS 10, , , .

0

: . , XSL, , RSS-, feedburner. , , , .


RSS-. ATS Apple. , . , " " .

, : 1. Allow Arbitrary Loads in Web Content. -, . 2. WKWebView RSS-, HTML - XML.

-, , , .

, URL.

0

Source: https://habr.com/ru/post/1665092/


All Articles