2

I am currently developing an application using Phonegap / Jekyll / Backbone. I am however in the need for a base path for my generation of static content. For Android platforms I use /android_asset/www/ which is working fine. I am however unable to find one for iOS, anyone has any idea about it?

Thanks in advance.

Kunlun
  • 53
  • 3
  • 6

1 Answers1

3

You have to asynchronously ask the iOS device to give you the root path. In deviceready function call:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFS, null);

When ready it will callback with a FileSystem object from which you can access the full root path.

function onFS(fs) {
    alert(fs.root.fullPath); 
}

Read more on PhoneGap/Cordova docs: http://docs.phonegap.com/en/edge/cordova_file_file.md.html#FileSystem

f055
  • 1,190
  • 12
  • 23