I’m using DirectoryContentsList::setDirectory() to hold a list of files for user to switch in my plugin, things works pretty fine on PC and Mac, but not on iOS AUv3 & standalone, seems it just won’t work.
Here’s my code:
After I load the file, I set the parent folder to be the directory, I tried both URL way and File way, won’t work.
And when I call getNumFiles() in the directory change callback, it always return 0, seems it’s not finding any files.
I’m not sure if it’s a limitation of iOS or a juce bug, or I need to do some convert on the file path, please help guide the proper way, thanks in advance!
By entitlements, do you mean settings in juce project? Right now it already can load local files in AUv3 using launchAsync function like juce tutorial did, but not this setDirectory…
You can set these entitlements up with Projucer if you need to, but until you verify that this is the issue I’d suggest just opening the generated XCode project and using it to get yourself oriented towards the problem.
Without knowing the nature of the directories you’re checking (are they in the app bundle or in the users Document path?) its hard to say this is the issue, but having been bitten by this myself many times over, I’d encourage you to investigate this in XCode, get it working, and then bring your changes up to Projucer/.jucer file when you figured it out.
The fact you can load AUv3 files that are (presumably?) packaged in the .app bundle doesn’t really mean that you don’t still have Entitlements issues - these .AUV3 bundles may be in an already-approved (sandbox) path, whereas the User directories are (likely?) outside that path and therefore require extra care … read the Apple docs, its pretty clear.
Actually the files I’m loading is not from my app/AUv3, it can be anywhere on a iOS device, I also didn’t use AppGroup or bundles at all, as far as I know they’re for files talking between your own apps, which is not my case. What I’m aiming for is let my AUv3 plugin load any file available on user’s device. Here’s a file pathURL example:
I know for iOS file restore I need to use URL and save the bookmark, which I already managed about that, and file restoring works fine, but not setDirectory()…