Double camera permission popup from WKWebView

336 Views Asked by At

I want to load my web app inside my iOS application using WKWebView. My web app built with react and has a feature to take a photo inside my app. I am using https://github.com/purple-technology/react-camera-pro for the camera libray. So when opening the camera page from the web app, I requested camera access with

AVCaptureDevice.requestAccess(for: .video) { [weak self] granted in
    // send JSBridge event
}

That will show a popup for requesting camera permission for my app enter image description here

But after that another similar popup will appear. enter image description here

This is how I create my WKWebView

let config = WKWebViewConfiguration()
config.websiteDataStore = WKWebsiteDataStore.default()
let webView = WKWebView(frame: CGRect.zero, configuration: config)

I want to remove the second request permission popup because it just feel useless because I already approve the first permission. Is there any way to do this?

0

There are 0 best solutions below