I get the ApplicationSupportDirectory path like this:
let path = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true)[0] as String
however for FileProvider plugin it looks like:
/var/mobile/Containers/Data/PluginKitPlugin/.../Library/Application Support/rclone.conf
instead of what I get for an Application:
/var/mobile/Containers/Data/Application/.../Library/Application Support
I need a way to get the Application's Support Directory from the FileProvider plugin.
Is that possible? If not, what other shared location I could use to access shared file between these two?
That’s expected. Your app extension is sandboxed and thus has a container that’s different from that of its container app.
The standard way to share content between the two is to have each claim access to an app group and then use the shared container associated with that app group. Locate that container by passing the app group ID to the containerURL(forSecurityApplicationGroupIdentifier:)
method.
App groups have a weird edge cases on macOS, especially if you’re coming from iOS. See App Groups: macOS vs iOS: Fight! for all the details.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"