I have downloaded a file into the folder "dataDirectory".
The document exists and its path is something like:
file:///data/data/app_id/files/file_name.pdf
so, when I'm trying to open it with cordova-open
after selecting acrobat reader I recive an error "Not valid path".
localFile = "file:///data/data/app_id/files/file_name.pdf"
cordova.plugins.disusered.open(localFile, function(){}, function({});
It could be a permissions problem?
Solution:
using cordova.file.externalDataDirectory it works!
解决方案
/data/data// is basically an internal storage and only the app for which it has been created has access for it. You will either need to use the external storage to share the file among other apps or you can implement the File Sharing feature .