如何使用cordova处理ios中下载的插件文件夹

How to use cordova to deal with downloaded plugin folder in ios

本文关键字:下载 插件 文件夹 ios 何使用 cordova 处理      更新时间:2023-09-26

我是一名iOS开发人员,现在我想使用cordova来开发web。当www文件夹在捆绑包中时,我知道如何使用cordova。但是,我想将www文件夹从远程服务器下载到本地沙箱中(例如/Documents)。现在我错过了。

我试着打开html文件如下:

CDVViewController *controller = [[CDVViewController alloc] init];
controller.wwwFolderName = @"file://~/Documents/www";
controller.startPage = @"index.html";
[self.navigationController pushViewController:controller animated:YES];

但它不能正常工作。它似乎调用了js函数(我在页面中添加了一个alert()调用),但没有显示html内容。

为什么?

您可以在iOS应用程序中使用Cordova作为组件。该组件的代号为"Cleaver"。

如果你想在你的母语中显示index.html,你需要使用cordova webview

http://docs.phonegap.com/en/1.9.0/guide_cordova-webview_ios.md.html