Smile-SA / cordova-plugin-fileopener

24 stars 28 forks source link

Fix issue #15 #18

Open chingfeng opened 6 years ago

chingfeng commented 6 years ago

Thank for this project(cordova-plugin-fileopener), it help me a lot. :)

This feature branch may be helpful to fix issue #15, and it work for me. Please review and decide merge or not.

marob commented 6 years ago

I haven't been able to make it work. The android.support.v4.content package is missing. Maybe we need to add <framework src="com.android.support:support-v4:23.3.0+" /> in plugins.xml?

chingfeng commented 6 years ago

Yes, we need to add it in plugins.xml

alsocalledchris commented 6 years ago

@marob does this work OK? I'm currently stuck with Android 7 not opening PDFs and I can't get the above fix working unfortunately - not sure what I'm doing wrong. Any ideas @chingfeng (also thanks for this fix! - not sure why its taking so long for Cordova to support Android 7.)

marob commented 6 years ago

@alsocalledchris I've not had the time to fully test it (also I'm not working in mobile development anymore so it doesn't really help). That's why the PR has not been merged yet. Have you tested with the fix in this PR or from the latest released version of this plugin?

alsocalledchris commented 6 years ago

@marob thanks, that's a shame - testing with the fix from the PR.

marob commented 6 years ago

@alsocalledchris Do you have any logs we could use to investigate?

chingfeng commented 6 years ago

In my case After merge PR, the plugin works well on SONY Tablet(Android 7.1.1) @alsocalledchris Maybe you can try some of bellow:

cordova plugin add https://github.com/chingfeng/cordova-plugin-fileopener.git

// Sample code const url = 'http://654lab.webstarts.com/uploads/csvt_overview.pdf' const onSuccess = (data) => { console.log('Success') } const onError = (error) => { console.log('Error') }
window.cordova.plugins.FileOpener.openFile(url, onSuccess, onError)

Eyrum commented 6 years ago

It works for me at Android 8.1.0

Flybring commented 5 years ago

Works on Android 9.0

marob commented 5 years ago

Can anyone validate that the PR is working? I don't have time nor a project to test against on my end.