Closed apparition47 closed 7 years ago
In terms of No Schema you are probably right there - this library should probably handle URL's without needing it to be specified so I will add that in.
In terms of HTTP vs HTTPS, unfortunately this is app specific and so if you want to use HTTP you will need to specify the keys you mentioned above manually. Also bear in mind that it appears Apple will be moving to enforce HTTPS usage in all apps at some point in the near future. This was originally scheduled to be brought in at the end of 2016 but was subsequently delayed with a now open ended deadline - but moving everything to HTTPS sooner rather than later is probably a good move. See here.
Thanks for the quick response. I thought about (2) a bit more after posting and I think you're right. I was confused at first because no error message. 0.1.2
with UIWebView logs:
SwiftWebVCExample[23423:1550909] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
but I guess that has more to do with UIWebView behaviour itself.
Not just loading pages using UIWebView
or WKWebView
, even just basic web connections are protected by ATS, e.g. NSURLConnection
, URLSession
, etc. It's essentially a system service protecting against any external connections it deems as insecure. So yeah, the only way around it is to set the keys in your Info.plist
and tell the OS you know these connections are potentially insecure, but you are happy to still make them.
Yes, you're right. But since my target is iOS 9+, I discovered I can use SafariServices to open an inline browser for http://
URLs in my app.
import SafariServices
let svc = SFSafariViewController(url: URL(string: "http://www.google.com")!)
present(svc, animated: true, completion: nil)
Thanks again!
Version:
0.4.0
I noticed there are two cases where your module gets stuck on a blank screen with a spinning Activity Indicator (see screenshot):
No schema
HTTP schema (not HTTPS)
I'm able to make this work if you create an iOS 8+ ATS exception for each HTTP domain or if you set
NSAllowsArbitraryLoads
.My question is: is there any way to allow HTTP links on WKWebView without doing the above?
Thanks!