fix(permissions): add camera and microphone usage descriptions - #250
Merged
Merged
Conversation
The app declares com.apple.security.device.camera and device.audio-input entitlements and forwards getUserMedia requests via requestMediaCapturePermissionFor, but Info.plist has no NSCameraUsageDescription or NSMicrophoneUsageDescription. Without those keys macOS cannot present the TCC consent prompt: the first getUserMedia call hangs with no error and no dialog, so camera and microphone never work on any site. Adding both strings lets the system prompt appear as expected.
|
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.
Problem
Camera and microphone never work on any site: the first
getUserMedia()call hangs forever with no error and no system dialog.The app already has everything else in place, entitlements:
and the WebKit delegate in
BrowserPage.swift:But
Info.plistdeclares neitherNSCameraUsageDescriptionnorNSMicrophoneUsageDescription. Without those strings macOS cannot present the TCC consent prompt, so the request is never surfaced to the user and the promise never settles.Change
Adds both keys (via
project.ymlso the generated project stays in sync). The wording is intentionally generic since the consumer is any website, not the app itself.Testing
Built Release on macOS 26.2 and loaded a page calling
getUserMedia({audio:true, video:true}). Before: no prompt, call hangs. After: the system prompt appears, andtccdlogsAUTHREQ_PROMPTINGforkTCCServiceMicrophoneandkTCCServiceCamerafollowed by aCreateevent once granted. Capture then works.