i have added the cordova-plugin-file to my project, but it does not seem to work. At least, when I try window.resolveLocalFileSystemURL it throws an undefined function error.
This code is inside the platform.ready event. Do I need to do anything else in ionic 2 to get this working?
I am trying this in the browser (ionic serve). The plugin states that it supports the browser as well.
Hy guys i have the same problem, but im trying it on an android device and i still get âwindow.resolveLocalFileSystemURLâ undefined:
âObject [object global] has no method âresolveLocalFileSystemURLââ
Iâve been having the same problem, I get the same error âwindow.resolveLocalFileSystemURL is not a functionâ both using ionic serve, and on android. This is quite frustratingâŚ
var myPath = cordova.file.externalRootDirectory; // We can use the default externalRootDirectory or use a path : file://my/custom/folder
window.resolveLocalFileSystemURL(myPath, function (dirEntry) {
console.log(dirEntry);
var directoryReader = dirEntry.createReader();
directoryReader.readEntries(onSuccessCallback,onFailCallback);
});
function onSuccessCallback(entries){
console.log( 'The magic will happen here, check out entries with');
console.log(entries);
}