From the team

Developer Blog

Product announcements, technical deep dives, and behind-the-scenes looks at what we are building for the Zoom Developer platform.


Meeting SDK

Best practices using the Meeting SDK in an iOS WebView

Tommy Gaessler1 min read
  • Best practices
  • iOS
  • web

Summary:Embed Zoom Meeting SDK for web in iOS WebView for smaller package size. Complete guide with Info.plist configuration, permissions, and Swift code examples.

Zoom recommends using the Meeting SDK for iOS in native iOS apps. However, if you are optimizing your iOS app for package size, the Meeting SDK for web can be embedded in an iOS WebView . This is now supported in Meeting SDK for web 2.10.1 and above.

Here are the best practices for using the Meeting SDK for web in an iOS WebView:

  1. Configure your App's Info.plist file to include the NSCameraUsageDescription  and NSMicrophoneUsageDescription  properties.

  2. Add the WebKit WKWebView code in your ViewController.swift file. Here is a great video  that demonstrates this. (The part in the video about JavaScript injection and User Agents is not required). In addition to the video, make sure to include the following in your webView class:

    configuration.allowsInlineMediaPlayback = true
    

    Here is a full example implementation:

    import UIKit
    import WebKit
    
    classViewController: UIViewController {
    
        let webView: WKWebView = {
            let prefs = WKWebpagePreferences()
            prefs.allowsContentJavaScript = true
            let configuration = WKWebViewConfiguration()
            configuration.defaultWebpagePreferences = prefs
            configuration.allowsInlineMediaPlayback = true
            let webView = WKWebView(frame: .zero, configuration: configuration)
            return webView
        }()
    
        override func viewDidLoad() {
            super.viewDidLoad()
            view.addSubview(webView)
            guardlet url = URL(string: "https://example.com/meetingsdk") else {
                return
            }
            webView.load(URLRequest(url: url))
        }
    
        override func viewDidLayoutSubviews() {
            super.viewDidLayoutSubviews()
            webView.frame = view.bounds
        }
    }