gpt4 book ai didi

ios - 适用于 iOS 26+ StageWebView 的 Adob​​e AIR 不会从 documentsDirectory 加载本地 HTML

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:32:07 29 4
gpt4 key购买 nike

多年来,我一直在使用 AIR for iOS 来构建在本地下载 HTML 文件并通过 stageWebView 加载它们的 iOS 应用程序,直到 AIR 26 发布。它停止从 documentsDirectory 加载本地 html。我收到以下错误消息 -

stagewebview.loadURL(path) returns an error - not able to reach location:[ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="The operation couldn't be completed. (kCFErrorDomainCFNetwork error 1.)" errorID=3228]

我尝试过使用这两种方法来获取文件路径,但都返回了上述错误。就是找不到本地保存文件的位置-

1.

var destination:File = File.documentsDirectory.resolvePath("29/index.html");
var fp = destination.nativePath;
path = "file://" + fp;
webView.loadURL(path);

2.

var destination:File = File.documentsDirectory.resolvePath("29/index.html");
path = new File(destination.nativePath).url;
webView.loadURL(path);

我什至尝试将 url 文件方案更改为“file://”、“file:///”和“file://”//”,但它们都找不到 AIR26 和 AIR 27 beta 中保存在 documentsDirectory 中的文件。该代码适用于 AIR 25 及以下版本。

我尝试从 applicationStorageDirectory 加载 html,但它也找不到 html 文件。

这是文档目录中的文件路径 -file:///var/mobile/Containers/Data/Application/device-specific-code/Documents/29/index.html

我很困惑,为什么相同的代码适用于 AIR 25 及更低版本,但自 AIR 26 起就停止工作了。

我到处搜索,找不到任何真正的答案。

任何见解/解决方案/解决方法都非常感谢。

谢谢!

最佳答案

不是解决方案,只是解决方法:使用 Air 版本 25。Since version 26 Adobe uses WKWebView instead of UIWebView至少在它们的实现中,这意味着无法加载本地文件。幸运的是,使用 AIR 25 编译的应用程序可以在 iOS 11 上运行。

关于ios - 适用于 iOS 26+ StageWebView 的 Adob​​e AIR 不会从 documentsDirectory 加载本地 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45642784/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com