Skip to content

[enhancement] add requestMediaCapturePermissionForOrigin support to avoid multiple permission request on getUserMedia call #1166

@RSATom

Description

@RSATom

Feature Request

Motivation Behind Feature

If use native WebRTC from WKWebView inside Cordova, every getUserMedia leads to new permission request to user. And this makes native WebRTC almost not suitable for use in production.

Feature Description

The simplest solution is add

- (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);
}

to https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
but it's definitely insecure solution, and application should have ability to respond to this request, or provide list of safe origins.

Alternatives or Workarounds

Didn't find any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions