4

我们正在尝试在不更新应用程序本身的情况下实现 webapp 资产的更新。

我将资产下载到 Documents/some/path/name 文件夹并尝试从该文件夹启动应用程序。

但应用程序日志显示.../Documents/..../index.html未找到。

这是我的代码示例:

NSString *wwwFolderName = @"web";

if ([directoryList count] > 0) {
    NSArray *sortedDirectoryList = [directoryList sortedArrayUsingSelector:@selector(compare:)];
    NSString *latestVersionFolder = [sortedDirectoryList objectAtIndex:([sortedDirectoryList count] - 1)];
    wwwFolderName = [appDirectory stringByAppendingPathComponent:latestVersionFolder];
}

// end of assets directory initialization


self.viewController = [[MainViewController alloc] init];
self.viewController.useSplashScreen = YES;
self.viewController.wwwFolderName = wwwFolderName;
self.viewController.startPage = @"index.html";

如何从 Documents 的应用程序特定文件夹启动 cordova 应用程序?

下载的资产路径:/var/mobile/Applications/{App-HASH}/Documents/revisions/123/

这是 Orgamizer 日志显示的内容:

错误:找不到“/var/mobile/Applications/10E317FA-CD51-4DD1-A07D-3C69EB4C5342/Documents/appname/790/index.html”处的起始页。
4

0 回答 0