phonegap到达iphone目录

时间:2012-06-23 18:42:39

标签: ios xcode ios5 cordova

我开始用xcode编写phonegap应用程序。我正在使用服务器编写更新检查器应用程序。首先,我使用服务器中的json文件检索应用程序内容。然后我需要到达iphone目录,以便与服务器比较这个应用程序是否存在。那么,如何到达phonegap中的iphone目录。谢谢 ps:抱歉我的英文。

1 个答案:

答案 0 :(得分:0)

使用文件API:http://docs.phonegap.com/en/1.8.1/cordova_file_file.md.html#File 您需要更新Cordova.plist文件:

<key>Plugins</key>
<dict>
    <key>File</key>
    <string>CDVFile</string>
</dict>

<key>Plugins</key>
<dict>
    <key>FileTransfer</key>
    <string>CDVFileTransfer</string>
</dict>

然后,您可以使用DirectoryReader / FileReader API检查文件。请注意,iOS沙箱应用程序意味着您只能看到与应用程序隔离的文件系统的一部分。