Skip to content

Commit 38f4c88

Browse files
committed
Allow geolocation and file chooser simultaneously
1 parent 9c05312 commit 38f4c88

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

android/src/main/java/com/flutter_webview_plugin/WebviewManager.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ public void onProgressChanged(WebView view, int progress) {
243243
args.put("progress", progress / 100.0);
244244
FlutterWebviewPlugin.channel.invokeMethod("onProgressChanged", args);
245245
}
246+
247+
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
248+
callback.invoke(origin, true, false);
249+
}
246250
});
247251
}
248252

@@ -367,12 +371,6 @@ void openUrl(
367371

368372
if (geolocationEnabled) {
369373
webView.getSettings().setGeolocationEnabled(true);
370-
webView.setWebChromeClient(new WebChromeClient() {
371-
@Override
372-
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
373-
callback.invoke(origin, true, false);
374-
}
375-
});
376374
}
377375

378376
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

0 commit comments

Comments
 (0)