WKWebview
is not loading certain urls. this is my code snippet
let myURL = URL(string: "https://contents.tdscpc.gov.in/")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
when I change the url to say URL(string: "https://www.ndtv.com/")
it works . Not sure why? any suggestions will be really helpful.
First check did you set the permission in the info.plist file ? If not then you just need to take permission of TransportSecurit to YES in info.plist
file
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Like below
If you are building an app for the Mac, make sure to turn App Sandbox
ON in your target and tick Networks
Incoming/Outgoing Connections.
Update: If you prefer the long way, add the following to YourAppName.entitlements
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With