-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Ask permission when using Filesystem.readFile or add permission into the Permission plugin #3492
Comments
iOS don't require permissions to read files, but can only read files inside its own sandbox, so you are probably trying to open a file outside the sandbox. Hard to tell because you didn't provide a sample app. |
Apologies. Here is a bit more detail: I am trying to grab a video but it doesn't seem possible in capacitor so I am using the cordova Camera plugin and the mediaType of VIDEO. I'm then using the returned FILE_URI to get the video so later I can upload it to vimeo
|
I'm having this very same issue today. While using the @ionic/camera (cordova-plugin-camera) within a capacitor app and reading a video from the library, it states: Reading image files from library with the exact same plugin is actually working perfectly, I suspect due the the following difference; The file is compressed (trimmed as iOS calls it) by cordova-plugin-camera and it looks like the directory is outside app scope: This is an example of a trimmed file which is somehow unreachable by the app: |
I still haven't found a solution to this, but will post here if I do. Would you let me know if you do too? Ideally this ticket could do with being re-opened |
Hey @spasma and @agomezmoron I've had another crack at this, if you copy the video into cache then read from that it seems to work okay.
|
Hi @mwyld, thank you for sharing your findings. A few days ago I found this issue on the camera plug-in, but I haven't checked the solution yet. My client postponed the options to select videos from the library due to the issue. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
Capacitor Version
Latest Dependencies:
@capacitor/cli: 2.4.0
@capacitor/core: 2.4.0
@capacitor/android: 2.4.0
@capacitor/electron: 2.4.0
@capacitor/ios: 2.4.0
Installed Dependencies:
@capacitor/electron not installed
@capacitor/cli 2.2.0
@capacitor/core 2.2.0
@capacitor/android 2.2.0
@capacitor/ios 2.2.0
[success] Android looking great! 👌
Found 4 Capacitor plugins for ios:
@capacitor-community/fcm (1.0.8)
@capacitor-community/firebase-analytics (0.2.0)
@capacitor-community/media (1.0.1)
cordova-plugin-camera (4.1.0)
[success] iOS looking great! 👌
Platform(s)
iOS
Current Behavior
When reading a file using the Filesystem plugin I am getting a permission issue. I can't find a solution
Expected Behavior
Prompt for permission when using the Filesystem plugin or add an extra functionality to do this in capacitor Permission plugin
Code Reproduction
When calling
await Filesystem.readFile({ path })
I am receiving:Other Technical Details
none
Additional Context
Is there a quick workaround for this issue I could implement now?
The text was updated successfully, but these errors were encountered: