ionic 4 iOS应用停留在iOS 13+的启动屏幕上

时间:2020-03-03 12:31:21

标签: ios cordova ionic4 ios13

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>

在这里我附上我的config.xml和index.html文件。

我的应用卡在ios13 +设备的启动屏幕中。因此,该应用被拒绝发布给应用商店。我尝试了很多事情来解决此错误。降级无法使用的启动画面插件,还向config.xml中添加了一些与启动画面相关的配置行,这也行不通。

应该怎么解决?

2 个答案:

答案 0 :(得分:0)

您应该在<platform name="ios">标签内添加以下代码:

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

从这里拍摄:https://cordova.apache.org/howto/2020/03/18/wkwebviewonly.html

答案 1 :(得分:0)

我从未使用过Cordova初始屏幕,但查看您的config.xml内容后,发现您有一个重复的SplashScreenDelay首选项,一个值为30000,相当于30秒,另一个的值为10000,这可能是问题背后的原因。我将删除重复的首选项并将时间值设置为5000(5秒),我也将添加{{1 }}首选项并将其设置为AutoHideSplashScreen,然后在false事件处理程序中添加一个计时器:

deviceready


应在here中进行解释。还要检查this
希望对您有帮助。