简体   繁体   English

ionic 4 iOS 应用程序卡在 iOS 13+ 上的启动画面

[英]ionic 4 iOS app stuck at splash screen on iOS 13+

config.xml配置文件

<xml version='1.0' encoding='utf-8'?>
<widget id="com.leo9.gameofplan" version="0.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Game Of Plan</name>
    <description>The Game of Plan app is designed to: Capture your Thoughts and Feelings and convert it into Tangible Action Plan.</description>
    <author email="info@leo9studio.com" href="https://leo9studio.com/">Le9studio Team</author>
    <content src="index.html" />
    <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:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="WKWebViewOnly" value="true" />
    <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="android-targetSdkVersion" value="28" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="10000" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="30000" />
    <preference name="OverrideUserAgent" value="Mozilla/5.0 Google" />
    <allow-navigation href="*" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-network-information" spec="~2.0.1" />
    <plugin name="cordova-plugin-secure-storage" spec="^3.0.2" />
    <plugin name="cordova-plugin-screen-orientation" spec="^3.0.2" />
</widget>

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Game of Plan</title> <base href="." /> <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="format-detection" content="telephone=no" /> <meta http-equiv="Content-Security-Policy" content="font-src 'self' data:; img-src * data:; default-src gap://ready file://* *; script-src 'self' 'unsafe-inline' 'unsafe-eval' * ; style-src 'self' 'unsafe-inline' *"> <meta name="msapplication-tap-highlight" content="no" /> <link rel="icon" type="image/png" href="assets/icon/favicon.png" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> </head> <body> <app-root></app-root> </body> </html>

here i attache my config.xml and index.html file.在这里我附上我的 config.xml 和 index.html 文件。

my app is stuck at splash screen in ios13+ devices.我的应用程序卡在 ios13+ 设备的启动画面上。 for that reasons the app is rejected for publish for app store.出于这个原因,该应用程序被拒绝发布到应用程序商店。 i tried many thing to resolve this error.我尝试了很多方法来解决这个错误。 degrade splash screen plugin that wont work, also added some splash screen related config line into config.xml that also wont work.降级无法工作的闪屏插件,还在 config.xml 中添加了一些与闪屏相关的配置行,但也无法工作。

what should be the solution?解决方案应该是什么?

Yu should add the following code inside your <platform name="ios"> tag: Yu 应该在您的<platform name="ios">标签中添加以下代码:

<feature name="CDVWKWebViewEngine">
   <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

Taken from here: https://cordova.apache.org/howto/2020/03/18/wkwebviewonly.html取自这里: https : //cordova.apache.org/howto/2020/03/18/wkwebviewonly.html

I have never used Cordova splashscreen but looking at your config.xml content I see that you have a duplicate SplashScreenDelay preference, one has a value of 30000 , the equivalent of 30 seconds and the other has a value of 10000 , this can be the reason behind the problem.我从未使用过 Cordova 启动画面,但查看您的config.xml内容,我看到您有重复的SplashScreenDelay首选项,一个值为30000 ,相当于 30 秒,另一个值为10000 ,这可能是原因问题的背后。
I would remove the duplicate preference and set the time value to 5000 (5 seconds), I would also add AutoHideSplashScreen preference and set it to false , then add the a timer in the deviceready event handler:我将删除重复的首选项并将时间值设置为 5000(5 秒),我还将添加AutoHideSplashScreen首选项并将其设置为false ,然后在deviceready事件处理程序中添加计时器:

function onDeviceReady() {
    setTimeout(function () {
        navigator.splashscreen.hide();
    }, 5000);
}


It should be explained in here .它应该在这里解释。 Check this too.也检查这个
I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM