Mitch Davis
Mitch Davis

Reputation: 183

Unable to load webpage in WKWebView

I have an app that is a simple WebKit that shows a webpage that is fronted by an nginx reverse proxy that forwards you to another page that no longer works on ios 12, though it works fine on ios 11. When it tries to load in the emulator or on a physical device it flashes the screen a couple times then goes to a white screen that shoes nothing and I see no errors in the console log.

--EDIT-- I'm now seeing this error in the console:

2018-10-02 20:27:57.332338-0500 PawsClaws-iOS[56878:10395839] 
[BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2] . 
[0x7fb677418f80] get output frames failed, state 8196

screen

import UIKit
import WebKit

class ViewController: UIViewController, WKUIDelegate {
    @IBOutlet weak var webView: WKWebView!

    override func viewDidLoad() {
        super.viewDidLoad()

        let url = URL(string: "http://inserturlhere")
    //        let url = URL(string: "https://apple.com")
        webView.load(URLRequest(url: url!))
    }
}

I've tried looking at the logs on safari using devtools, but unfortunately I don't see anything. If I change the url to point at another URL that does not redirect (ie google) it works just fine. Also, I can open the same url in a regular browser session with any browser (Chrome, Safari, Firefox). Can anyone help point me in a direction to diagnose this?

Upvotes: 2

Views: 2199

Answers (1)

DP's
DP's

Reputation: 209

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>abc.com</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSIncludesSubdomains</key>
                <true/>
            </dict>
        </dict>

</dict>

Have you added this to your info.plist?

Upvotes: 1

Related Questions