Phonegap navigator.fileMgr is always undefined

I am creating an iOS application using PhoneGap, you need to write and read a text file on the device.

I followed these steps: http://docs.phonegap.com/en/2.0.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS

Everything works fine, except that I cannot use any of the APIs (I tried the file and notification). I call: alert (navigator.fileMgr), but always undefined.

I call this in the deviceready callback function.

I think I skipped some important steps, can anyone have experience with this, give me a link / guide / help?

Thanks in advance!

+1
source share
1 answer

, , navigator.fileMgr . API W3C:

http://docs.phonegap.com/en/2.0.0/cordova_file_file.md.html#File

, :

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSys) {
    console.log("File system root = " + fileSys.root.fullPath);
}, function() {
    console.log("Could not get file system");
});

/ docs.

+1

Source: https://habr.com/ru/post/1794578/


All Articles