How to trigger filesystem User Consent Prompt and add app to 'Files and Folders' privacy pane?

Viewed 224

macOS 10.15 Catalina requires additional user consent to access directories such as Desktop, Documents, and Downloads.

Advances in macOS Security - WWDC 2019

https://developer.apple.com/videos/play/wwdc2019/701/

enter image description here

Attempting to access these folders in some manner (the answer to this question) is designed to trigger a reactive User Consent Prompt:

User Consent Prompt

"YOUR_APP.app" would like to access files in your Documents folder.

After the prompt has been shown, the app is added to the Files and Folders pane of System Preferences where it can then be checked or unchecked.

Even when the pane is unlocked, the "+" plus button is grayed out. Apps seemingly cannot be manually added. They are added by the system after triggering a User Consent Prompt.

Files and Folders permissions

I would like my app to show up in this pane.

I'm attempting to "access files" on the Desktop, but I'm never getting a prompt and my app never appears in System Preferences.

Which specific APIs will trigger these system prompts for the protected Catalina file locations?

Which file access methods will not trigger the prompts?

Are there any additional steps for Sandboxed apps attempting to access these file locations?

Are any Entitlements or Info.plist keys or other setup required in order for the prompts to appear or for you to gain access to these directories?

Can these prompts be triggered on command, without doing any "real" file system work?

Are there any situations where the prompts will not appear for an app? How can that app be made to appear in System Preferences?

0 Answers
Related