iOS application base path

前端 未结 1 1573
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-15 04:36

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 platfo

相关标签:
1条回答
  • 2021-01-15 05:01

    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

    0 讨论(0)
提交回复
热议问题