Question

I wonder is it possible to keep list of files or folders opened before on sandboxed app without re-opening them or copying to it's own library ?

Thanks in advance

Was it helpful?

Solution

At this time only using temporary entitlements.

You should use something like

<plist version="1.0">
    <dict>
        <key>com.apple.security.app-sandbox</key>
        <true/>
        <key>com.apple.security.files.user-selected.read-write</key>
        <true/>
        <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
        <array>
            <string>absolute path to use</string>
        </array>
    </dict>
</plist>

I hope Apple will clarify how this can be done without 'temporary' solutions because it breaks many many apps

OTHER TIPS

To keep track of files being accessed by the user, you should create security bookmarks for each file, then that will allow your application to access these files on future runs of the application without getting permission everytime.

I've made this class that wraps up persisting permissions you already have from a using opening a file via NSOpenPanel, and then you can use the class to access that file in the future.

https://github.com/leighmcculloch/AppSandboxFileAccess

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top