New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The camera and microphone access issue on electron after signing the app for mac os #17640
Comments
|
We found the issue. We missed to add the security key for accessing microphone and camera as below in our plist. com.apple.security.device.camera NSMicrophoneUsageDescription |
|
@rodent129 how did you actually do this? I'm running into the same issue. Did you just edit the plist file: |
|
Add this to your "build": {
"mac": {
"hardenedRuntime": true,
"entitlements": "entitlements.mac.plist",
"extendInfo": {
"NSMicrophoneUsageDescription": "Please give us access to your microphone"
}
}
}The file <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
</dict>
</plist>These settings are for an app that will be notarized, which requires hardened runtime. |
|
For me, the issue was that So, I googled a bit and found this article - https://medium.com/@stephen.cty/notarize-electron-app-for-macos-catalina-10-15-d994e29dfe82 Which in some point saying do not add Now my config looks like this: Hope this will help! |
|
@AleshaOleg and others with troubles signing/notarizing, here is a blog post that explains in detail how to get this set up. Thought it may be useful for others that stumble upon this thread https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ |
|
For showing an access window for the camera you should add into entitlements.mac.plist |
@rodent129 where do you put these key and strings |
@mickael-menu where is the file |
Issue Details
Expected Behavior
The angular desktop app with electron can access camera and microphone access on Mojave after signing the app.
Actual Behavior
The app cannot access camera and microphone on Mojave after signing the app.
To Reproduce
We are building the angular desktop app with electron for mac os. Current app electron version is v4.1.3 and electron packager is v13.1.1. Our app needs to access camera and microphone. We know that mojave has strict access on microphone and camera, so we already use request permission to access these.
First access camera with
navigator.mediaDevices.getUserMedia({audio: false, video: true}).then(xxx).catch(this.handleError.bind(this));
If error occured, then through IPC request media access permission: systemPreferences.askForMediaAccess(mediaType).then()
Running app from command line with electron is working ok. The permission window is pop up and microphone/camera can access after allowed. Without code signing app, access camera and microphone has long dealy. After referencing this #16105, it mentioned that code signing solve the issue.
But when we are packing and signing with electron packager and osxSign, the app cannot access to microphone and camera on mojave.
Could someone help to take a look for this?
Thanks a lot.
The text was updated successfully, but these errors were encountered: