Open chingfeng opened 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
?
Yes, we need to add it in plugins.xml
@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.)
@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?
@marob thanks, that's a shame - testing with the fix from the PR.
@alsocalledchris Do you have any logs we could use to investigate?
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)
It works for me at Android 8.1.0
Works on Android 9.0
Can anyone validate that the PR is working? I don't have time nor a project to test against on my end.
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.