Enable WebRTC Support in WKWebView/UIWebView

Published

I am developing a flutter application using WebRTC in webview. On android, it is working as expected, but facing issues on iOS build. I have read the threads Apple Support and SO Thread.

Both threads state, WebRTC is not allowed inside iOS webview. I tested my code in emulator/real-device, but unsuccessful.

So, my question is anybody know how can I run the WebRTC in iOS webview?

This is how I am showing the webview

InAppWebView(
                initialUrl: widget.callType == AppConstant.INCOMING ? incomingUrl : outGoingUrl,
                initialOptions: InAppWebViewGroupOptions(
                  crossPlatform: InAppWebViewOptions(
                      mediaPlaybackRequiresUserGesture: false,
                      debuggingEnabled: true,
                      clearCache: true,
                      javaScriptEnabled: true,
                      preferredContentMode: UserPreferredContentMode.MOBILE
                  ),
                ),
                onWebViewCreated: (InAppWebViewController controller) {
                  //web view created
                },
                androidOnPermissionRequest: (InAppWebViewController controller, String origin, List<String> resources) async {
                  print('resource list : ${resources.toString()}');
                  return PermissionRequestResponse(resources: resources, action: PermissionRequestResponseAction.GRANT);
                }
            );

Source: Ios Questions

Published
Categorised as android, flutter, ios, swift, wkwebview Tagged , , , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq