apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Spash screen disappears before this.splashScreen.hide() #1220

Open ArMouReR opened 2 years ago

ArMouReR commented 2 years ago

Problem

In my Ionic app I have very strange situation: the splash screen disappears before I call this.splashScreen.hide();

What is expected to happen?

Splash screen should hide only after this.splashScreen.hide();

What does actually happen?

The splash screen is hidden as soon as webview is loaded. I have tried to debug the issue in Xcode and when I set break point in CDVViewCoontroller.m in function showLaunchScreen() I see that the call to this function is happening form my code after deviceReady event and during this call the Splash Screen already tuned off.

Information

I am using the Ionic 6 framework.

"cordova-plugin-splashscreen": "^6.0.0",
"cordova-ios": "^6.2.0",
"@ionic-native/splash-screen": "^5.36.0

Here is the ionic/cordova information for environment:

Ionic:

   Ionic CLI                     : 6.18.1
   Ionic Framework               : @ionic/angular 6.0.1
   @angular-devkit/build-angular : 13.1.2
   @angular-devkit/schematics    : 13.1.2
   @angular/cli                  : 13.1.2
   @ionic/angular-toolkit        : 5.0.3

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : android 9.0.0, ios 6.2.0
   Cordova Plugins   : 

cordova-plugin-android-permissions 1.0.2 "Permissions"
cordova-plugin-app-version 0.1.12 "AppVersion"
cordova-plugin-camera-preview 0.11.0 "cordova-plugin-camera-preview"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-inappbrowser 4.1.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-nativeaudio 3.0.9 "Cordova Native Audio"
cordova-plugin-splashscreen 6.0.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-sqlite-storage 6.0.0 "Cordova SQLite storage plugin - cordova-sqlite-storage plugin version"

Utility:

   cordova-res : 0.15.4
   native-run  : not installed globally

System:

   Android SDK Tools : 26.1.1 (/usr/local/share/android-sdk)
   ios-sim           : 8.0.2
   NodeJS            : v14.15.0 (/Users/admin/.nvm/versions/node/v14.15.0/bin/node)
   npm               : 6.14.8
   OS                : macOS Monterey
   Xcode             : Xcode 13.2.1 Build version 13C100

Config.xml params:

preference name="SplashMaintainAspectRatio" value="true" />
preference name="FadeSplashScreen" value="false" />
preference name="FadeSplashScreenDuration" value="500" />
preference name="SplashShowOnlyFirstTime" value="false" />
preference name="SplashScreen" value="screen" />
preference name="SplashScreenDelay" value="20000" />
preference name="AutoHideSplashScreen" value="true" />
preference name="WKWebViewOnly" value="true" />
preference name="backgroundColor" value="0x00000000" />

General thoughts...

AutoHideSplashScreen is set to true with huge delay, but changing it to false doesn't solves the problem. I do have background set 0x0 - I need my app to be transparent in order to show up over camera view. It seem like splash screen has z-index lower than main view, because I do see splash screen in the begging, then main view is loaded and I see on the background splash screen, and then after this.splashScreen.hide(); the splash screen disappears from background.

mayainle commented 2 years ago

I have something similar, the launch Screen shows up for a super short time and then the webview is shown. Event if I add AutoHideSplashScreen to false and a long delay time I just see it for a very short time before the webview overlaps it. Any ideas (coedova-ios 6.2.0)?

ArMouReR commented 2 years ago

I haven't found the solution yet, so if you find something let me know. If you want me to try something to help you I am ready as well...

dpogue commented 1 month ago

I've tested this in Cordova-iOS 7.1.0 and I cannot reproduce the issue as described. Please test and confirm if you are still seeing this issue, otherwise we will close this issue.