Add permission by default WebView Permission Decision Grant
Objective c :
- (void) webView:(WKWebView *)webView
requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin
initiatedByFrame:(WKFrameInfo *)frame type:(WKMediaCaptureType)type
decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler
API_AVAILABLE(ios(15.0))
{
decisionHandler(WKPermissionDecisionGrant);
}
Swift :
func webView(_ webView: WKWebView,
requestMediaCapturePermissionFor
origin: WKSecurityOrigin,initiatedByFrame
frame: WKFrameInfo,type: WKMediaCaptureType,
decisionHandler: @escaping (WKPermissionDecision) -> Void){
decisionHandler(.grant)
}