DocumentPicker isn't allowing all file types when browsing iCloud Drive locations
See original GitHub issueWe’ve got an Expo app that we’re currently preparing for release and we use Expo DocumentPicker
during the onboarding process. We’ve discovered that when browsing iCloud Drive locations only a subset of files/types are selectable. As far as I can tell we’ve setup everything correctly according to the Configuration.
The .keystore
files we’re using (and some other file types eg. .sketch
) our greyed out and unselectable, but only on iCloud Drive.
- The file we’re trying to select is a JSON document using
.keystore
extension. - Everything works correctly on Android (whether using phone local locations or remote locations)
- Everything works correctly on iPhone when picking local files or from other remote locations (eg. Google Drive)
- We can pick other files from iCloud Drive (eg. images or PDF’s), they come into our app and the app has some logic to report that they’re invalid files.
Am I missing some required config? Is this a bug? Any help is much appreciated
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Access and manage your files in iCloud Drive - Apple Support
iCloud Drive lets you securely access all of your documents from your iPhone, iPad, iPod touch, Mac, and Windows PC.
Read more >iCloud Document Picker: App folders are disabled on import
I checked google drive's iCloud import and it's not disabled like in the image below: Google Drive iCloud import. I need to get...
Read more >DocumentPicker - Expo Documentation
DocumentPicker. expo-document-picker provides access to the system's UI for selecting documents from the available providers on the user's device.
Read more >react-native-document-picker - npm
A react native interface to access documents from dropbox, google drive, iCloud.... Latest version: 8.1.3, last published: a month ago.
Read more >iCloud Drive and Document Picker for iOS 8: Explained - iMore
There are many different types of files. Text files, documents, spreadsheets, presentations, and images are all common types. The saved state of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, I finally found the solution to this. I needed to declare the document types that our app can handle.
I really think this should be made clearer in the
DocumentPicker
docs. I went around in circles for a long time, and even when I thought I had it figured out, there were no concrete examples I could find anywhere of declaring document types inapp.json
. I basically had to map some iOSInfo.plist
XML examples into theapp.json
format.It’s clearly not impossible to work it out, but it took a long time for me to work out and it’s definitely not friendly to newcomers.
For what it’s worth if anyone else stumbles across this, these are roughly what I ended up with in my
app.json
(You can search any of the keys to find the reference in the Apple docs to customise to your needs):@bkbooth The above sample worked perfectly on iOS, huge thanks for sharing. Have you found the equivalent solution for Android as well, so that it is possible to narrow down the available extensions instead of using
*/*
?