Window.resolveLocalFileSystemURI is not a function

I created a web app that I need to convert to a mobile app, now all I have are html5 / js / css files, which means I don't have any www foder no platform folder, not a cordova project ... I first started building an app using cordova command lines, but I couldn't, I had a lot of problems, I used https://build.phonegap.com/ and it works great for me. To read the file, I tried this code:

    window.resolveLocalFileSystemURI("file:///android_asset/www/data/User.xml", function () {
        alert("Success");
    }, function () {
        alert(" error ");
    });

      

but it didn't work. I added the try catch

exception:

window.resolveLocalFileSystemURI is not a function

      

Do I need to add something to my code for it to work?

+3


source to share


1 answer


You need to install a plugin for this.

Basically, run the cordova plugin, add org.apache.cordova.file to your app's root directory.



For detailed instructions see Function Access: http://docs.phonegap.com/en/edge/cordova_file_file.md.html#LocalFileSystem

+3


source







All Articles