Код: Выделить всё
Код: Выделить всё
class WebViewActivity : AppCompatActivity() {
class ModifiedWebChromeClient: WebChromeClient() {
override fun onGeolocationPermissionsShowPrompt(origin: String?, callback: GeolocationPermissions.Callback?) {
callback!!.invoke(origin, true, false);
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_blind_spot_web_view)
val webView: WebView = findViewById(R.id.webView)
val webSettings = webView.settings
webSettings.javaScriptEnabled = true
webSettings.setGeolocationEnabled(true)
val client = ModifiedWebChromeClient()
webView.webChromeClient = client
webView.loadUrl("https://www.example.com")
}
}
Код: Выделить всё
Caught security exception while registering for location updates from the system. The application does not have sufficient geolocation permissions.
Подробнее здесь: https://stackoverflow.com/questions/504 ... d-after-23