Navjeeven Mann
Navjeeven Mann

Reputation: 93

Loading Twitter in WKWebView not Supported

I'm trying to load Twitter in a WKWebView on my iPad Pro. But whenever I load it up in my app it says browser not supported.

Error Message

Here is what I have currently tried,

var wk = WKWebView()
wk.configuration.preferences.javaScriptEnabled = true
self.view = wk
wk.load(URLRequest(url: URL(string: "https://www.twitter.com")!))

Is there something that I am missing? Or can somebody else reproduce and maybe it is twitter's problem? Thanks

Upvotes: 0

Views: 643

Answers (1)

Anh
Anh

Reputation: 6533

Something like this fixes the problem as of Nov 2020:

webView.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15"

Upvotes: 2

Related Questions