This project is a demo app in Swift showcasing how to embed Whereby in a WKWebView
within a native iOS app. More details about Whereby can be found in the Whereby documentation.
Screen 1 | Screen 2 |
---|---|
![]() |
![]() |
- The latest version of Xcode installed
- A Whereby room URL or a web app embedding Whereby
- The initial screen allows the user to input a URL, which can be:
- A Whereby room URL (either 'Meetings' or 'Embedded').
- A web app that embeds Whereby using the Whereby Embed Element
- A web app that embeds Whereby using the Whereby React Hooks
- Handles media permission prompts for microphone and camera access.
- Manages external links within the WebView.
- Supports file downloads.
- Clone this repository:
git clone https://github.com/whereby/ios-webview-demo.git cd WherebyWebViewDemo-iOS
- Open
WherebyWebViewDemo-iOS.xcodeproj
in Xcode. - Ensure you have an Apple Developer account set up.
- (Optional) To run the app on a physical device, navigate to Signing & Capabilities in the project settings and set up a valid development team.
- Build and run the app on a simulator or a physical device.
- Launch the app.
- Enter a valid URL in the input field.
- Tap the "Load Webview" button.
To fully utilize the app's features, the following permissions must be configured in the info.plist file:
- NSMicrophoneUsageDescription - Microphone Access
- NSCameraUsageDescription - Camera Access
- NSPhotoLibraryUsageDescription - Photo Library Access
- NSPhotoLibraryAddUsageDescription - Photo Library Additions
The WebViewController.swift file contains the implementation of WKWebView
and its delegate methods, including:
- Usage of
WKWebViewConfiguration
to enable inline media playback. - Handling microphone and camera permission to automatically grant media access to the WebView without repeated prompts.
- Managing links that open in new windows/tabs.
- Supporting file downloads and presenting a document picker.
If loading a Whereby meeting room URL, you can combined URL parameters to customize the user experience. We recommend using skipMediaPermissionPrompt
as the WKWebView
already handles the media permission prompt.
This project is licensed under the MIT License. See LICENSE
for details.