Here's what needs to be done in order to use security scoped bookmarks on Mac Catalyst:
-
You need an entitlement: "com.apple.security.files.bookmarks.app-scope" needs to be se to 1.
-
Pass both
NSURLBookmarkCreationWithSecurityScope
andNSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess
when creating the bookmark.
Note: The headers mark these API as unavailable for iOS, and this indeed does only work on Mac and not iOS. However, Mac Catalyst really is a Mac app, so using these values is fine. In order to allow compilation, use following: