Smile-SA / cordova-plugin-fileopener

24 stars 28 forks source link

exposed beyond app through Intent.getData() #15

Open san0suke opened 7 years ago

san0suke commented 7 years ago
window.cordova.plugins.FileOpener.openFile("file:///storage/emulated/0/Download/nf.pdf", function(r) {
    console.log("sucesso:", r);
}, function (r) {
    console.log("erro:", r);
});

erro: file:///storage/emulated/0/Download/nf.pdf exposed beyond app through Intent.getData()

marob commented 7 years ago

Hi,

it seems to be an Android N-related issue as explained here and here.

Two solutions:

Regards

jodacame commented 6 years ago

@marob solution #1 worked, thanks

frankvlocity commented 5 years ago

Hi,

it seems to be an Android N-related issue as explained here and here.

Two solutions:

  • change your targetSdkVersion to 23 or lower. It is the easiest solution, but it's only a workaround for now
  • follow the recommendations in the blog post, but it requires modifications in the cordova-plugin-fileopener (you're welcome to submit a pull request) and some configurations in your app (AndroidManifest.xml and res/xml/provider_paths.xml)

Regards

Thank you so much for the suggestions! Both solutions worked!

marob commented 5 years ago

Indeed the https://github.com/Smile-SA/cordova-plugin-fileopener/pull/18 PR is pending as I have no time nor any project to test it against. I could merge it but it seems risky without further testing.

parshwa1596 commented 4 years ago

if targetsdk version is 29 what can i do?

marob commented 4 years ago

if targetsdk version is 29 what can i do?

You can try to use https://github.com/chingfeng/cordova-plugin-fileopener/commit/474a4cb11941ac17782e099a023c7d57cc110f50

marob commented 4 years ago

Either the https://github.com/chingfeng/cordova-plugin-fileopener/commit/474a4cb11941ac17782e099a023c7d57cc110f50 version is not working, or you're not really using this version (make sure you clean and rebuild).

parshwa1596 commented 4 years ago

if targetsdk version is 29 what can i do?

You can try to use chingfeng@474a4cb

not solve using these solution.

parshwa1596 commented 4 years ago

hi i got profile pic in pdf what can i do?