How to use Camera and Mic in CustomWebView?

In this guide I’ll explain about using camera and mic in CustomWebView extension.

First of all create 3 global variables.

Now setup webview on Screen initialize.

You’ll need to setup events as following

When WebView asks for permission we store them in two global variables. One is for asking permissions and other is for granting them to WebView when we have got necessary permissions for the app. Since we can grant permissions to webview only when the App has got equivalent permissions to itself. So we get app version of these webview permissions which is stored in pDict global variable. However, if app already has all permissions then we just grant the permissions to webview.

After getting permission for app we remove it from the first list in order to keep the permission request flow running. But if there are no more permissions to ask for then we grant all permissions to webview.

So that’s the way to access cam and mic in webview.

Here is the final Aia:

Thank you for reading this. Hope it helps!

One thought on “How to use Camera and Mic in CustomWebView?

Leave a Reply