App Group Folder Access

In NOISE we don’t use the NSFileManager at all to locate shared resources. We simply use JUCE’s File::getSpecialLocation (File::invokedExecutableFile) which will return the path of the AUv3 if you’re code is executing inside the AUv3. You can then, for example, get the Resources directory of the parent app bundle. Something like this (not tested):

File getSharedResourceFolder()
{
    File bundle = File::getSpecialLocation (File::invokedExecutableFile).getParentDirectory();

    // macOS uses Contents/MacOS structrue, iOS bundle structure is flat
   #if JUCE_MAC
    bundle = bundle.getParentDirectory().getParentDirectory();
   #endif

    // appex is in a PlugIns folder inside the parent bundle
    if (SystemStats::isRunningInAppExtensionSandbox())
        bundle = bundle.getParentDirectory().getParentDirectory();

   #if JUCE_MAC
    bundle = bundle.getChildFile ("Resources");
   #endif

    return bundle;
}

If both the AUv3 and the parent app are in the same app group then both will be able to access this resource folder. Also note, that currently, there is no way in the Projucer to add your app/AUv3 to an app group. You need to do this manually in Xcode every time you re-save your .jucer file:

I think it also requires you to register the app group with Apple online somehow - but Xcode should complain when you try to tick the app group box and you haven’t set this up online correctly.