1

Before prompting the user to grant FDA to my app, I have to know whether I already have it.

What's a reliable way to check this?

Note: I used to check for access to ~/Library/Safari/Bookmarks.plist, but on a fresh 10.14 system, this file may not even exist, thereby now allowing me to check whether I can access it. Same issue with checking for Calendar or Contact database files.

Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149

1 Answers1

4

I ran into this need myself and discovered PermissionsKit. They too were looking at ~/Library/Safari/Bookmarks.plist - they changed it to use ~/Library/Safari/CloudTabs.db in 10.15. In macOS 12 I found that file no longer exists in fresh installs so they now use ~/Library/Application Support/com.apple.TCC/TCC.db (the Transparency, Consent, and Control database, so hopefully this doesn't go away so easily!). They've actually updated it to check multiple files so should be more reliable.

It's a shame there isn't an API to determine our access state and we have to resort to such fragile solutions.

Jordan H
  • 52,571
  • 37
  • 201
  • 351
  • Unfortunately, Apple has now protected *that* file as of 10.15.7. We're back to not having a solution for this other than "show the prompt when the user first does an action that would require it and trust that they did it. If you get an error, prompt them again." – Zack Jan 25 '21 at 21:14
  • @Zack This continues to work for me on macOS 11.1. – Jordan H Jan 25 '21 at 22:42
  • 2
    Yup, I wrote this about a week before I actually understood what was going on with disk permissions. Turns out that Full Disk Access is incompatible with App Sandbox and that was the actual issue I was facing. – Zack Feb 04 '21 at 17:21