I have an android app that is used by several thousand users. And recently one user contacted me with a problem that his Instagram login page is not loading. He said that he does not use vpn or anything else that could in any way affect the Internet connection. I cannot understand what the reason for this behavior is, this is an isolated case out of many thousands.
This is how I start the loading:
webView.clearCache(true)
webView.clearFormData()
webView.clearHistory()
webView.clearSslPreferences()
webView.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
view.loadUrl(url)
return false
}
override fun onLoadResource(view: WebView?, url: String?) {
// some my code
}
}
webView.settings.javaScriptEnabled = true
webView.settings.domStorageEnabled = true
webView.settings.loadWithOverviewMode = true
webView.settings.useWideViewPort = true
webView.settings.userAgentString = InstagramClient.Configuration.current.webUserAgent
webView.post {
run {
webView.loadUrl("https://www.instagram.com/accounts/login/")
}
}
The webUserAgent (if it matters):
val webUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS $osVersion like Mac OS X) " +
"AppleWebKit/$webKitVersion (KHTML, like Gecko) $safariVersion"
I will be glad for any help!
