I have a very simple web-view browser in my app, that works great except some sites. For example, https://apsny.market doesn't load a page because "browser is not supported". I tried to load this page in Safari and Chrome in iOS, and it works perfect as aspected. Maybe I need to set something in WKWebViewConfiguration, but I tried and nothing happened... I will appreciate any ideas. Thanks in advance!
And my simple code:
guard let myURL = URL(string: url) else { return }
let webConfiguration = WKWebViewConfiguration()
let webView = WKWebView(frame: .zero, configuration: webConfiguration)
let myRequest = URLRequest(url: myURL)
webView.load(myRequest)
webView.navigationDelegate = self
This site blocks mobile browsers by checking User-Agent
header value in your request but you can change a User Agent for your web view to desktop one:
webView.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36"