Support for native iOS and Android file choosers is now on develop with commit 7e23bf2. This also adds support for the asynchronous invocation of native file choosers. You can preview the new native file choosers in the JUCE Demo (except on iOS - see notes below on how to enable native file choosers in the JUCE Demo on iOS).
iOS: There are a few steps required for your app to be able to invoke the native file chooser on iOS. First of all you’ll need to rebuild the Projucer. You then need to enable “iCloud Permissions” and code-signing (“Development Team ID”) in the Projucer:
When enabling code-signing you need to be sure to use the correct team id. After this, you need to add iCloud containers to your app in your iCloud developer console. You can also have Xcode do this for you, by disabling and enabling the “iCloud Documents” tick-box in the Capabilities tab in your project settings:
You only have to do this once - after the iCloud container was added to your app, it’s stored online with your apple developer account. You can then safely delete your xcode project and regenerate it with the Projucer and you should not need to do any additional manual steps.
Furthermore, the user needs to install the iCloud app on their device and have used it at least once. In certain situations you may want to have a different application user flow depending on if the native iOS file chooser can be shown or not (for example, if the user does not have iCloud installed or has not logged into it yet). For this, you can use the static method
FileChooser::isPlatformDialogAvailable() to check the availability of the native file chooser at runtime.
As the JUCE Demo is not code signed, by default, the JUCE Demo will not show native file choosers on iOS. You’ll need to enable iCloud permissions and add your own code signing identity to the JUCE Demo to preview it.
Android: Using a native file chooser on Android is much easier than on iOS. All you need to do is rebuild the Projucer and then re-save your project. Note, that Android does not support modal loops! Therefore, you must use the asynchronous methods in the FileChooser class to open any FileChooser (native or non-native) on Android.