Skip to content

Commit 3cb8338

Browse files
authored
docs: add hardened runtime entitlement info (electron#24369)
1 parent a69a655 commit 3cb8338

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/tutorial/code-signing.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,25 @@ To see all of this in action, check out Electron Fiddle's source code,
100100
[especially its `electron-forge` configuration
101101
file](https://github.com/electron/fiddle/blob/master/forge.config.js).
102102

103+
If you plan to access the microphone or camera within your app using Electron's APIs, you'll also
104+
need to add the following entitlements:
105+
106+
```xml
107+
<key>com.apple.security.device.audio-input</key>
108+
<true/>
109+
<key>com.apple.security.device.camera</key>
110+
<true/>
111+
```
112+
113+
If these are not present in your app's entitlements when you invoke, for example:
114+
115+
```js
116+
const { systemPreferences } = require('electron')
117+
118+
const microphone = systemPreferences.askForMediaAccess('microphone')
119+
```
120+
121+
Your app may crash. See the Resource Access section in [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) for more information and entitlements you may need.
103122

104123
## `electron-builder`
105124

0 commit comments

Comments
 (0)