Closed jordan-jarolim closed 3 years ago
Now I am starting to understand your tiny hack there :) https://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed - would it make sense to completely migrate to content://
schema? I am happy to do a pull request in case you agree. But I am not sure about the other consequences.
Thank you
if u can fix it, please do it and I will merge your changes
I fix this with android FileProvider, kindly get the new version, and it has new features for preview the files from anywhere
Hi, I am trying to use the library to preview a file stored locally on the device (file is saved by Capacitor.Plugins.Filesystem). Everything works just ok on iOS, file preview is displayed as expected but I have troubles on android. File preview is closed immediately. File path is 'file:///storage/emulated/0/Documents/Payslip.pdf'. I also tried different locations.
I played a bit with the Java code and ended up having a solution which is proposed here: https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en. This is working for me, however, this is the exact opposite from what is mentioned in the readme about
file://
vscontent://
uri.Specifically, I added this part in
presentFile
method:Could you please point me to a right direction what I might be doing wrong? I am absolutely new to android programming. You can find my working solution here: https://github.com/jordan-jarolim/previewAnyFile/commit/f783da335972f655629c334c0c90d5b2151edef1
Thank you.