Cordova应用在iOS 12,iPhoneX上重新加载自身

问题描述 投票:3回答:1

我有一个在TestFlight中使用Cordova(iOS引擎4.4.0)开发的iOS应用。除最新的iOS 12 beta之外,一切都很好。

[用户报告说,该应用会在iOS 12(iPhoneX)上随机重启。这是随机发生的,可能是由用户与DOM的交互触发的,但并非总是如此。

[我已经在装有iOS 12的iPhone6S上进行了测试,但还没有复制它,所以我想知道它是否特定于iPhoneX + iOS 12。

用户没有该应用程序的崩溃报告,这使我认为是WebView重新加载页面(它是单页应用程序),而不是实际的应用程序崩溃。

[在其他任何设备或iOS版本上都不会发生-其他人遇到过这种情况或有解决方案吗?

这是我的Cordova config.xml的主要部分:

<content src="index.html" />
<preference name="BackupWebStorage" value="local" />
<feature name="CDVWKWebViewEngine">
    <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<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="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="KeepRunning" value="false" />
<preference name="Fullscreen" value="true" />
<platform name="android">
    <allow-intent href="market:*" />
    <icon density="ldpi" src="res/android/ldpi.png" />
    <icon density="mdpi" src="res/android/mdpi.png" />
    <icon density="hdpi" src="res/android/hdpi.png" />
    <icon density="xhdpi" src="res/android/xhdpi.png" />
    <icon density="xxhdpi" src="res/android/xxhdpi.png" />
    <icon density="xxxhdpi" src="res/android/xxxhdpi.png" />
    <splash density="land-hdpi" src="res/screen/android/drawable-land-hdpi.png" />
    <splash density="land-ldpi" src="res/screen/android/drawable-land-ldpi.png" />
    <splash density="land-mdpi" src="res/screen/android/drawable-land-mdpi.png" />
    <splash density="land-xhdpi" src="res/screen/android/drawable-land-xhdpi.png" />
    <splash density="land-xxhdpi" src="res/screen/android/drawable-land-xxhdpi.png" />
    <splash density="land-xxxhdpi" src="res/screen/android/drawable-land-xxxhdpi.png" />
    <splash density="port-hdpi" src="res/screen/android/drawable-port-hdpi.png" />
    <splash density="port-ldpi" src="res/screen/android/drawable-port-ldpi.png" />
    <splash density="port-mdpi" src="res/screen/android/drawable-port-mdpi.png" />
    <splash density="port-xhdpi" src="res/screen/android/drawable-port-xhdpi.png" />
    <splash density="port-xxhdpi" src="res/screen/android/drawable-port-xxhdpi.png" />
    <splash density="port-xxxhdpi" src="res/screen/android/drawable-port-xxxhdpi.png" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <icon height="180" src="res/ios/[email protected]" width="180" />
    <icon height="60" src="res/ios/icon-60.png" width="60" />
    <icon height="120" src="res/ios/[email protected]" width="120" />
    <icon height="76" src="res/ios/icon-76.png" width="76" />
    <icon height="152" src="res/ios/[email protected]" width="152" />
    <icon height="40" src="res/ios/icon-40.png" width="40" />
    <icon height="80" src="res/ios/[email protected]" width="80" />
    <icon height="57" src="res/ios/icon.png" width="57" />
    <icon height="114" src="res/ios/[email protected]" width="114" />
    <icon height="72" src="res/ios/icon-72.png" width="72" />
    <icon height="144" src="res/ios/[email protected]" width="144" />
    <icon height="167" src="res/ios/icon-167.png" width="167" />
    <icon height="29" src="res/ios/icon-small.png" width="29" />
    <icon height="58" src="res/ios/[email protected]" width="58" />
    <icon height="50" src="res/ios/icon-50.png" width="50" />
    <icon height="100" src="res/ios/[email protected]" width="100" />
    <icon height="167" src="res/ios/[email protected]" width="167" />
    <splash src="res/screen/ios/Default@2x~universal~anyany.png" />
</platform>
<plugin name="cordova-plugin-file" spec="^5.0.0" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.14" />
<plugin name="cordova-plugin-splashscreen" spec="^4.1.0" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-plugin-screen-orientation" spec="^3.0.1" />
<engine name="ios" spec="^4.4.0" />
ios cordova webview wkwebview ios12
1个回答
0
投票

我们也通过Cordova应用程序解决了这个问题,我们花了很长时间才解决。

[最近切换到wkwebview之后,应用程序中的文件上传器页面通常在文件上传完成之前就开始重新加载。这仅适用于使用iPhone X和iOS 12的用户。在我们的案例中,更改Bootstrap微调控件可以解决问题。似乎很疯狂……但是,一旦我们修改了组件,问题就消失了。

© www.soinside.com 2019 - 2024. All rights reserved.