我正在構建我的苗條應用程式。在 config.xml 檔案中,我的目標<content src="./public/index.html" />是在 Android 上完美運行。
當我嘗試在 ios 上啟動它時:
- 閃屏顯示。
- 啟影片面逐漸變為白色。
- 頁面為空白,包含:
<html><head></head><body></body></html>
控制臺出現以下錯誤:
Failed to load resource: the server responded with a status of 404 () - ionic://localhost
我嘗試添加:
<preference name="Hostname" value="public" />
or
<preference name="Hostname" value="app" />
or
<preference name="Hostname" value="localhost/public" />
但無濟于事。
我正在使用以下版本/依賴項:
dependencies:
"cordova": "^11.0.0"
devDependencies:
"cordova-ios": "^6.2.0",
"cordova-plugin-exclude-files": "^1.0.1",
"cordova-plugin-inappbrowser": "^5.0.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-splashscreen": "^6.0.1",
"cordova-plugin-whitelist": "^1.3.4"
我有以下允許/導航:
<access launch-external="yes" origin="mailto:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<allow-intent href="mailto:*" />
<allow-navigation href="http://*" />
<allow-navigation href="https://*" />
<allow-navigation href="*" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
在 macOS Monterey 上運行 - 版本 12.3.1
xcode:版本 13.3.1 (13E500a)
uj5u.com熱心網友回復:
您的問題出在 ionic-webview 中的 UIWebView 上。它不再在 iOS 中可用。您需要切換到電容器。電容器正在使用 WKWebView。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/480625.html
