bug: File picker not working on iOS if types (mime) option is defined
Plugin(s)
- [ ] Android Battery Optimization
- [ ] Android Dark Mode Support
- [ ] Android Edge-to-Edge Support
- [ ] Android Foreground Service
- [ ] App Review
- [ ] App Shortcuts
- [ ] App Update
- [ ] Asset Manager
- [ ] Audio Recorder
- [ ] Background Task
- [ ] Badge
- [ ] Bluetooth Low Energy
- [ ] Cloudinary
- [ ] Contacts
- [ ] Datetime Picker
- [ ] File Compressor
- [ ] File Opener
- [x] File Picker
- [ ] Live Update
- [ ] Managed Configurations
- [ ] NFC
- [ ] Photo Editor
- [ ] Posthog
- [ ] Printer
- [ ] Screen Orientation
- [ ] Screenshot
- [ ] Speech Recognition
- [ ] Speech Synthesis
- [ ] Torch
- [ ] Zip
Version
7.0.1
Platform(s)
- [ ] Android
- [x] iOS
- [ ] Web
Current behavior
On iOS devices, the pickFiles doesn't work and doesn't show any error when you use the option PickFilesOptions::types
NB: it works correctly on developement IPA, but not in production one
Expected behavior
PickFilesOptions::types option should not block the process of picking up files
Reproduction
https://github.com/aless673/cap-file-picker-ios-bug
Steps to reproduce
- build production IPA with this repo : https://github.com/aless673/cap-file-picker-ios-bug
- try on real device
Other information
No response
Capacitor doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0
Installed Dependencies:
@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0
[success] Android looking great! 👌
[error] Xcode is not installed
Before submitting
- [x] I have read and followed the bug report guidelines.
- [x] I have attached links to possibly related issues and discussions.
- [x] I understand that incomplete issues (e.g. without reproduction) are closed.
This issue has been labeled as needs: reproduction. This label is added to issues that need a code reproduction.
Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so we can debug the issue.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for us to reproduce the issue.
@robingenz reproduction added
@robingenz reproduction is done since 1 month, can we change the labels ?
Hey there, any updates on this ?
I'm having this issue aswell using pickFiles with types option on iOS (opens documents but can't select any file)
N.B. works fine on android and web
const result = await FilePicker.pickFiles({
types: ['image/*', 'video/*'],
});
Hey there, any updates on this ? I'm having this issue aswell using
pickFileswithtypesoption on iOS (opens documents but can't select any file) N.B. works fine on android and webconst result = await FilePicker.pickFiles({ types: ['image/*', 'video/*'], });
I would recommend you to not restrict types, but to filter post-selection. That's obviously a temporary fix
That's what I ended up doing ye, thanks tho ! Hope this will be fixed soon
We haven't had time to look into it yet. However, PRs are welcome.