apache / cordova-ios

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

Splash screen is not hiding with this.splashscreen.hide() on iOS #1137

Closed ASHBAW closed 2 years ago

ASHBAW commented 2 years ago

Bug Report

Problem

On an iOS device this.splashscreen.hide() does not hide the splash screen. On Android devices this works correctly.

What is expected to happen?

splashscreen should hide after this.splashscreen.hide() is called.

What does actually happen?

Splashscreen stays displayed. If I turn my device to the side I can see part of the background screen.

Information

If I change the following in config.xml from false <preference name="AutoHideSplashScreen" value="false" />

to true <preference name="AutoHideSplashScreen" value="true" />

after 5 seconds <preference name="SplashScreenDelay" value="5000" />

the splashscreen on iOS devices will hide.

Using this.splashscreen.hide() does not work.

Command or Code

In config.xml have the following: <preference name="AutoHideSplashScreen" value="false" />

Within the app.component.ts I have the following:

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      setTimeout(() => {
        this.splashScreen.hide();
      }, 1000);
    });
  }

This has worked before on iOS devices on a number of other older Ionic projects. This now only works with Android devices.

Environment, Platform, Device

The issue occurs on iOS devices. It does NOT occur on Android devices.

Version information

I am using the Ionic 5 framework. I create a new project and am using the following:

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

Here is the ionic/cordova information for environment:

Ionic:

   Ionic CLI                     : 6.16.3 (/Users/b/.nvm/versions/node/v14.17.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.13
   @angular-devkit/build-angular : 12.1.4
   @angular-devkit/schematics    : 12.1.4
   @angular/cli                  : 12.1.4
   @ionic/angular-toolkit        : 4.0.0

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 9.1.0, ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 10 other plugins)

Utility:

   cordova-res : 0.15.3
   native-run  : 1.4.0

System:

   ios-deploy : 1.11.4
   ios-sim    : 8.0.2
   NodeJS     : v14.17.1 (/Users/b/.nvm/versions/node/v14.17.1/bin/node)
   npm        : 7.20.0
   OS         : macOS Big Sur
   Xcode      : Xcode 12.5.1 Build version 12E507

Checklist

jcesarmobile commented 2 years ago

That’s a problem on ionic-native, since the plugin is integrated into cordova-iOS, the ionic-native wrapper no longer works. You have to use the regular js api instead of the ionic native wrapper.

ArMouReR commented 2 years ago

Have you solved this issue ? My problem is that splashScreen hides without (before) call to hide()

jcesarmobile commented 2 years ago

Do you have <preference name="AutoHideSplashScreen" value="false" /> in you config.xml? Looks like the opposite of the issue, it’s better if you create your own providing a sample app if possible