electron icon indicating copy to clipboard operation
electron copied to clipboard

Adding support for NSScreenCaptureUsageDescription

Open obaid opened this issue 1 year ago • 3 comments

Adding support for NSScreenCaptureUsageDescription so that my app can capture system audio / screen recording if needed. This needs to be part of build file.

obaid avatar Oct 18 '24 23:10 obaid

But this doesn't need to be a part of everyone's app...

Instead of making this something that's applied to every app, I'd prefer a mechanism here that allows the developer to choose which grants they're going to need

It could be something that goes in the NativePHP config file

simonhamp avatar Oct 19 '24 10:10 simonhamp

@simonhamp Happy to help add that ability. If you have any pointers on how to go about it, that would be helpful.

obaid avatar Oct 21 '24 05:10 obaid

@obaid I'm not sure exactly, but I'm thinking perhaps a config key in the config/nativephp.php such as mac_entitlements which contains an array of entitlements, e.g.

'mac_entitlements' => [
    'NSScreenCaptureUsageDescription' => "Application requests access to the user's screen capture and system audio",
]

Then there would need to be some logic in electron-builder.js to fetch the values from the PHP config (e.g. using an Artisan command) and merge them with some defaults (the ones already in the electron-builder.js)

Does this make sense?

simonhamp avatar Oct 21 '24 09:10 simonhamp

Closing as it's outdated. Feel free to open a new PR with the relevant functionality as discussed if you've managed to make any progress there.

simonhamp avatar May 21 '25 18:05 simonhamp