简体   繁体   中英

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.

my app is stuck at splash screen in ios13+ devices. 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.

what should be the solution?

Yu should add the following code inside your <platform name="ios"> tag:

<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

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.
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:

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


It should be explained in here . Check this too.
I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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