Cordova IOS 应用程序在 IOS 14 中显示白屏

Cordova IOS app shows white screen in IOS 14

Cordova IOS 应用程序在 IOS 14 中显示白屏。但应用程序在 IOS 14 版本以下运行。我将 Xcode 更新到版本 12.0。 Cordova IOS 平台版本为6.1.0。科尔多瓦版本是 10.0.0。以下是 config.xml 文件中的插件详细信息和首选项。

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-splashscreen" spec="^6.0.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />

<preference name="auto-hide-splash-screen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="0" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="2000" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="orientation" value="portrait" />
<preference name="DisallowOverscroll" value="true" />

我尝试删除除白名单之外的所有插件。我删除了与启动画面相关的首选项并尝试了它。静态应用显示白屏。

请帮帮我。任何帮助都应该受到赞赏。提前致谢。

我找到了答案。

我卸载了闪屏插件。默认情况下,启动画面在 Cordova IOS 平台 6.1.0.

中可用

在项目根文件夹中,检查 res 文件夹。如果 res 文件夹不可用,我们必须创建一个类似“res/screen/ios/”的 res 文件夹路径,并将启动画面图像上传到 ios 文件夹。

然后将此添加到您的 config.xml

<splash src="res/screen/ios/screen-ipad-landscape-2x.png" />
<splash src="res/screen/ios/screen-ipad-landscape.png" />
<splash src="res/screen/ios/screen-ipad-portrait-2x.png" />
<splash src="res/screen/ios/screen-ipad-portrait.png" />
<splash src="res/screen/ios/screen-iphone-landscape-2x.png" />
<splash src="res/screen/ios/screen-iphone-landscape.png" />
<splash src="res/screen/ios/screen-iphone-portrait-2x.png" />
<splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" />
<splash src="res/screen/ios/screen-iphone-portrait.png" />

下面是经过编辑的 config.xml 代码,对我有用。

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
    <allow-intent href="market:*" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
    
    <splash src="res/screen/ios/screen-ipad-landscape-2x.png" />
    <splash src="res/screen/ios/screen-ipad-landscape.png" />
    <splash src="res/screen/ios/screen-ipad-portrait-2x.png" />
    <splash src="res/screen/ios/screen-ipad-portrait.png" />
    <splash src="res/screen/ios/screen-iphone-landscape-2x.png" />
    <splash src="res/screen/ios/screen-iphone-landscape.png" />
    <splash src="res/screen/ios/screen-iphone-portrait-2x.png" />
    <splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" />
    <splash src="res/screen/ios/screen-iphone-portrait.png" />
</platform>

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />

干杯。

我降级到cordova-ios@5.1.1.