Skip to content

Commit d735e13

Browse files
authored
apacheGH-706 android: Allow permissions requests (apache#968)
Co-authored-by: joanb-moncasoft <[email protected]>
1 parent 65e86c7 commit d735e13

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/android/InAppChromeClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Licensed to the Apache Software Foundation (ASF) under one
3434
import android.webkit.WebView;
3535
import android.webkit.WebViewClient;
3636
import android.webkit.GeolocationPermissions.Callback;
37+
import android.webkit.PermissionRequest;
3738

3839
public class InAppChromeClient extends WebChromeClient {
3940

@@ -45,6 +46,13 @@ public InAppChromeClient(CordovaWebView webView) {
4546
super();
4647
this.webView = webView;
4748
}
49+
50+
public void onPermissionRequest(final PermissionRequest request) {
51+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
52+
request.grant(request.getResources());
53+
}
54+
}
55+
4856
/**
4957
* Handle database quota exceeded notification.
5058
*

0 commit comments

Comments
 (0)