I've tried so many methods to open my document file (pdf, xls, docx) and one method is using cordova-plugin-file-opener2 I've already tried adding the plugin where the link should be in github, but it still doesn't work. When I tried using it, It shows this error:
Error: exec proxy not found for :: FileOpener2 :: open
Error status: undefined - Error message: undefined
Am I missing something?
P.S. I've already tried cordova-plugin-file and cordova-plugin-file-transfer but still doesn't work. And I'm confident that the FileOpener2 is much more convenient than the other plugins to open a file.
Anyway, here's my code. I hope someone can help. I've been stuck for like 1 week now.
cordova.plugins.fileOpener2.open(
filePath,
'application/pdf',
{
error : function(e) {
console.log(filePath);
console.log('Error status: ' + e.status + ' - Error message: ' + e.meesage);
},
success : function() {
console.log('file opened successfully');
}
}
);