Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase Splash Screen time in ionic for IOS devices

I need to increase time delay of splash screen in ios devices. I'm using IONIC.

Following is my config file:

<feature name="SplashScreen">
    <param name="ios-package" value="CDVSplashScreen"/>
    <param name="onload" value="true" />
</feature>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="orientation" value="portrait"/>
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="8000"/>
  <preference name="AutoHideSplashScreen" value="false"/>
<preference name="auto-hide-splash-screen" value="false" />

It's working in Android device by simply adjusting SplashScreenDelay. I don't know why splash screen is hiding automatically after setting AutoHideSplashScreen is false.

like image 316
DAN Avatar asked May 19 '15 10:05

DAN


People also ask

How do I set the time on my splash screen?

Time interval settings The splash screen will be displayed for a specific time period and will then be closed. By default, the value will be set as 5000. User can change this value, run the application and see the difference. The time interval for which the splash screen is to be displayed (in milliseconds).

How do you add a splash screen to an ionic 5 capacitor?

Open android studio and locate the drawable files. In android studio, open resource folder in app -> res . Right click the drawable folder, then click Show in Explorer . Change all images in the drawable folders using your new splash screen.


2 Answers

You can disable the automatic handling of splash screen and programmatically hide it when the app is ready.

Originally from ionicframework forum (with slight changes):

Install the cordova splashscreen plugin:

cordova plugin add cordova-plugin-splashscreen

Make sure you have the following in config.xml of your project:

<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />

In app.js, add the following in the run method:

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

After adding, the code should look as follows:

angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'app.services', 'app.directives'])
.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {

    // Hide splash screen
    setTimeout(function() {
        navigator.splashscreen.hide();
    }, 100);

    // some other things
  });
})
like image 90
Farshid T Avatar answered Sep 20 '22 13:09

Farshid T


We can implement this by installing cordova splashscreen plugin .For more refer link http://learn.ionicframework.com/formulas/splash-screen/

cordova plugin add org.apache.cordova.splashscreen

app.run(function($cordovaSplashscreen) {
  setTimeout(function() {
    $cordovaSplashscreen.hide()
  }, 5000)
})
like image 27
DAN Avatar answered Sep 21 '22 13:09

DAN