Browse Source

docs: add hardened runtime entitlement info (#24369)

Shelley Vohr 4 years ago
parent
commit
3cb833821a
1 changed files with 19 additions and 0 deletions
  1. 19 0
      docs/tutorial/code-signing.md

+ 19 - 0
docs/tutorial/code-signing.md

@@ -100,6 +100,25 @@ To see all of this in action, check out Electron Fiddle's source code,
 [especially its `electron-forge` configuration
 file](https://github.com/electron/fiddle/blob/master/forge.config.js).
 
+If you plan to access the microphone or camera within your app using Electron's APIs, you'll also
+need to add the following entitlements:
+
+```xml
+<key>com.apple.security.device.audio-input</key>
+<true/>
+<key>com.apple.security.device.camera</key>
+<true/>
+```
+
+If these are not present in your app's entitlements when you invoke, for example:
+
+```js
+const { systemPreferences } = require('electron')
+
+const microphone = systemPreferences.askForMediaAccess('microphone')
+```
+
+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.
 
 ## `electron-builder`