I have a simple Cocoa image viewer application. A user selects a file using NSOpenPanel
, and the application creates a preview image using the Quick Look API.
I would like to move the preview creation to a separate XPC service. Without the sandbox application, everything works fine, but after turning on the application sandbox for the parent application and the XPC service, the XPC service is denied read access to the user-selected file.
The parent application is allowed to read the file (because it was selected using NSOpenPanel).
How do I transfer file permissions for a user-selected file from the parent application to the XPC process so that the XPC process can read the file to create a preview?
The XPC service requests access to read files through its rights, and I added the following key to the XPC service's Service Info.plist, but this did not help:
JoinExistingSession = YES
source share