cordova - access file system iOS device using phonegap -
i developing ios app using phonegap. application should able download files internet, storing them directory created in device. have done same thing android target, , code works properly. creates directory in phone, download , save files. in ios code doesn't work. i've tried search solutions in web, without results.
here code:
document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { alert("device ready"); window.requestfilesystem(localfilesystem.persistent, 0, onfilesystemsuccess, fail); } function onfilesystemsuccess(filesystem) { console.log(filesystem.name); console.log(filesystem.root.name); var directoryentry = filesystem.root; directoryentry.getdirectory("mydir", {create: true, exclusive: false}, ondirectorysuccess, ondirectoryfail); } function ondirectorysuccess(parent) { console.log(parent); window.localstorage.setitem("directory_path",parent.tourl()+'/'); } function ondirectoryfail(error) { alert("unable create new directory: " + error.code); } function fail(evt) { console.log(evt.target.error.code); }
in console can see output:
2014-04-14 17:30:11.338 xxxxxx[1511:60b] multi-tasking -> device: yes, app: yes 2014-04-14 17:30:11.350 xxxxxx[1511:60b] unlimited access network resources 2014-04-14 17:30:11.470 xxxxxx[1511:60b] [cdvtimer][file] 4.680991ms 2014-04-14 17:30:11.613 xxxxxx[1511:60b] [cdvtimer][splashscreen] 140.942991ms 2014-04-14 17:30:11.615 xxxxxx[1511:60b] [cdvtimer][totalpluginstartup] 149.509966ms 2014-04-14 17:30:11.640 xxxxxx[1511:60b] active 2014-04-14 17:30:13.902 xxxxxx[1511:60b] resetting plugins due page load. 2014-04-14 17:30:14.334 xxxxxx[1511:60b] failed load webpage error: operation couldn’t completed. (nsurlerrordomain error -999.) 2014-04-14 17:30:14.335 xxxxxx[1511:60b] resetting plugins due page load. 2014-04-14 17:30:14.718 xxxxxx[1511:60b] finished load of: file:///var/mobile/applications/3a5b82c4-3787-442f-858f-e0850f4a6338/xxxxxx.app/www/home.html
Comments
Post a Comment