feat: grant WKWebView camera permission for liveness challenge - #224
Merged
Conversation
Implement WKUIDelegate.requestMediaCapturePermissionFor to grant camera capture so the camera-based liveness challenge's getUserMedia call can start; WKWebView auto-denies otherwise. Camera-only — the challenge uses video with audio:false, and denying microphone avoids requiring the host app to declare NSMicrophoneUsageDescription. Add NSCameraUsageDescription to the example app Info.plist and bump the podspec to 3.1.0. ENG-5947, ENG-5978
- Log the capture-permission decision via Log.debug, matching the other delegate methods in this file. - Add NSCameraUsageDescription to the example targets that use a generated Info.plist and so didn't inherit it from Shared/Info.plist: SwiftUI-Example (its partial Info.plist) and Passive-Example (INFOPLIST_KEY build setting, Debug + Release). - Document the required NSCameraUsageDescription host-app key in the README pre-requisites. - Clarify that .cameraAndMicrophone is intentionally denied; keep the doc comment ASCII-only. ENG-5947, ENG-5978
- ci: build Passive-Example in samples_build (the only example target that relies on the new INFOPLIST_KEY_NSCameraUsageDescription build setting, so the change is now exercised in CI) - docs: de-duplicate the microphone-denial rationale, keeping it inline - docs: clarify the README camera-usage note wording ENG-5947, ENG-5978
Address multi-reviewer consistency pass: - Revert podspec 3.1.0->3.0.1 and drop the CHANGELOG entry. The recent 3.x cadence bumps the version in a dedicated release PR, and bumping here left Example/Podfile.lock stale (3.0.1) against the repo invariant that any podspec version change regenerates the lock. Deferring fixes both. - Trim the requestMediaCapturePermissionFor doc comment to the file's terse one/two-line norm and drop the non-ASCII em-dash; the camera-only/mic rationale already lives in the inline comment.
|
Cocoapods size report: |
matthew-ransley-imi
marked this pull request as ready for review
June 19, 2026 15:49
matthew-ransley-imi
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WKWebView auto-denies getUserMedia, so the camera-based liveness challenge can't start the camera on iOS. This adds the WKUIDelegate permission method to grant it, camera only since the challenge doesn't use the microphone (which keeps NSMicrophoneUsageDescription out of it). It also adds NSCameraUsageDescription to the example apps and a short README note that integrating apps need to declare it. Liveness requires iOS 15.
Verified the SDK framework builds and the full unit suite passes (123 tests).
ENG-5947, ENG-5978