Hello
I tried to open a simple one page PDF file from:
- external url (e.g basic http://www...../test.pdf)
- local file using relative path (e.g ./test.pdf)
- local file using absolute pah (e.g file:///android_asset/www/test.pdf)
Below is the result of tests using DocumentHandler@0.2.2 plugin on android (app built using cordova 7.1.0):
// Android 7 / 8: KO - app instantly crashes
// Android 6: OK
handleDocumentWithURL(function(){ console.info('success'); }, function(){ console.error(arguments); }, EXTERNAL_URL);
// Android 6 / 7 / 8: KO - 1 (undefined error)
handleDocumentWithURL(function(){ console.info('success'); }, function(){ console.error(arguments); }, LOCAL_RELATIVE_PATH);
// Android 6 / 7 / 8: KO - app instantly crashes
handleDocumentWithURL(function(){ console.info('success'); }, function(){ console.error(arguments); }, LOCAL_ABSOLUTE_PATH);
Note: We've used the exact same version of the plugin on an app during summer 2016 (1 year and a half ago) and it is working on Android 6 / 7 / 8, so I suppose this plugin just lacks maintenance to be compatible with recent Cordova versions?
Alternatives:
Hello
I tried to open a simple one page PDF file from:
Below is the result of tests using DocumentHandler@0.2.2 plugin on android (app built using cordova 7.1.0):
// Android 7 / 8: KO - app instantly crashes
// Android 6: OK
handleDocumentWithURL(function(){ console.info('success'); }, function(){ console.error(arguments); }, EXTERNAL_URL);// Android 6 / 7 / 8: KO - 1 (undefined error)
handleDocumentWithURL(function(){ console.info('success'); }, function(){ console.error(arguments); }, LOCAL_RELATIVE_PATH);// Android 6 / 7 / 8: KO - app instantly crashes
handleDocumentWithURL(function(){ console.info('success'); }, function(){ console.error(arguments); }, LOCAL_ABSOLUTE_PATH);Note: We've used the exact same version of the plugin on an app during summer 2016 (1 year and a half ago) and it is working on Android 6 / 7 / 8, so I suppose this plugin just lacks maintenance to be compatible with recent Cordova versions?
Alternatives:
window.open(decodeURI(EXTERNAL_URL), '_system', 'location=no');