Skip to content
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

The file couldn’t be opened because you don’t have permission to view it. #32

Open
colinethrl opened this issue Jul 21, 2021 · 0 comments

Comments

@colinethrl
Copy link

Hey there, I'm using this plugin to share photos from the photo gallery to my app, and although it works fine on emulator, it doesn't on real device.

On emulator, the image is stored in :
file:///Users/<my_name>/Library/Developer/CoreSimulator/Devices/D5C7BC3D-F9FB-4444-BA30-DC11E32C066D/data/Media/PhotoData/OutgoingTemp/28D91F3B-21F7-4DBD-8FF6-F273EF068844/IMG_0002.JPG

And I can access it easily using the fileSystem.

But on real device the path looks like :
file:///var/mobile/Media/PhotoData/OutgoingTemp/A535F1DB-4973-49D0-AE70-B05FDD65416A/IMG_1519.PNG

And when I do fileSystem.readFile() it returns this error :

{"errorMessage":"The file “IMG_1519.PNG” couldn’t be opened because you don’t have permission to view it.","message":"The file “IMG_1519.PNG” couldn’t be opened because you don’t have permission to view it."}

I tried copying it to another place, I have the same error.
I tried adding
UIFileSharingEnabled

LSSupportsOpeningDocumentsInPlace

to my Info.plist, no success either.

I even tried manually triggering the "access to Photo Library" permission pop up, but it doesn't seem to change anything.

I also have a place in my app where I use an input to access the Photo Library from the app so the user can pick a picture, and I can pick the one I've been trying to share. In this case, the Camera Plugin stores it in another temporary place, which is accessible :
file:///private/var/mobile/Containers/Data/Application/F62330AB-847E-45B2-AA93-E7D85AAD1251/tmp/photo-1.jpg

How can I change the place where the extension places my picture data ? Or maybe there's a way of retrieving directly the base64 data from the plugin ?

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant