Skip to content

Commit 9bd013d

Browse files
authored
Merge pull request #441 from iamluciano/master
Android: allow geolocation and file chooser simultaneously
2 parents bc2f8cd + 337c137 commit 9bd013d

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

@@ -371,12 +375,6 @@ void openUrl(
371375

372376
if (geolocationEnabled) {
373377
webView.getSettings().setGeolocationEnabled(true);
374-
webView.setWebChromeClient(new WebChromeClient() {
375-
@Override
376-
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
377-
callback.invoke(origin, true, false);
378-
}
379-
});
380378
}
381379

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

0 commit comments

Comments
 (0)