DAN
DAN

Reputation: 3240

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.

Upvotes: 6

Views: 15058

Answers (3)

Farshid T
Farshid T

Reputation: 2273

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
  });
})

Upvotes: 9

Kamal Kumar
Kamal Kumar

Reputation: 3763

platforms\android\cordova\default.xml

You can add default configuration that is needed for config.xml.

At run time config.xml will changed by ionic framework so needs to change in default.xml will refelect in config.xml too.

Upvotes: 0

DAN
DAN

Reputation: 3240

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)
})

Upvotes: 6

Related Questions