Telephony 3 - LocalFileSystem not defined

I used this code in phonegap 2.6.0 and it worked, now I upgraded to phonegap 3.0.0 and xcode 5 and I get this error:

onDeviceReady: =>
    try
        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, failFS)
    catch e
        alert(e)


**ReferenceError: LocalFileSystem is not defined** 

I get the same error in Chrome, and I assume this is normal?

The documentation is still unchanged from 2.6 to 3, so I'm not sure what happened!

+4
source share
3 answers

I solved the problem of adding the cordova.js file to the / ios / www / platforms

+2
source

You must add the File plugin to your application using:

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git

You can check this: http://docs.phonegap.com/en/edge/cordova_file_file.md.html#File

+1
source
window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
function gotFS(fileSystem) {
    console.log("got filesystem"); 
    console.log(fileSystem.root.fullPath);   
}
function fail() {
   console.log("failed to get filesystem");
}
0

All Articles