|
|
@@ -204,7 +204,8 @@ class WebviewManager {
|
|
|
boolean scrollBar,
|
|
|
boolean supportMultipleWindows,
|
|
|
boolean appCacheEnabled,
|
|
|
- boolean allowFileURLs
|
|
|
+ boolean allowFileURLs,
|
|
|
+ boolean geolocationEnabled
|
|
|
) {
|
|
|
webView.getSettings().setJavaScriptEnabled(withJavascript);
|
|
|
webView.getSettings().setBuiltInZoomControls(withZoom);
|
|
|
@@ -219,6 +220,16 @@ class WebviewManager {
|
|
|
webView.getSettings().setAllowFileAccessFromFileURLs(allowFileURLs);
|
|
|
webView.getSettings().setAllowUniversalAccessFromFileURLs(allowFileURLs);
|
|
|
|
|
|
+ if (geolocationEnabled) {
|
|
|
+ webView.getSettings().setGeolocationEnabled(true);
|
|
|
+ webView.setWebChromeClient(new WebChromeClient() {
|
|
|
+ @Override
|
|
|
+ public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
|
|
|
+ callback.invoke(origin, true, false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
|
|
|
}
|