I'm developing a File Provider extension for both iOS and macOS. I'm using [-NSFileProviderManager temporaryDirectoryURLWithError:]
for a temporary storage location for various operations. Now, I want to clean up the dir after previous launches of application and it's extensions. However, I'm getting NSFileReadNoPermissionError while trying to access directories created by extension with container app and vice versa. At the same time, extension can access items created by other extension processes just fine, and, respectively, containing app can access files created by it's previous launches. Part of the problem is, I guess, is that the dir given by the OS has the form of /Users/CURRENT_USER/Library/Containers/CONTAINING_APP_BUNDLE_IDENTIFIER/Data/tmp
, which is not inside application's group container. On the other hand, I don't have control over that's directory location.
So, the question is: is this a bug or there is an API which will allow application and it's extensions to grant file access to each other like it happens automagically inside the group container?