How to avoid white screen after splash screen


master controller is “Appctrl” .i added localStorage for store token key.when app open have to check that.if token expired.have to direct to login page.functions are working.but after splash screen, until authentication function finish,the screen was white to avoid it?code pattern or any idea for it? thank you

here is controllers.js

angular.module(‘app.controllers’, [])

*App Controller 1st run
.controller(‘AppCtrl’, function ($scope, $state, $ionicPopup, AuthService, AUTH_EVENTS,$ionicPlatform,$ionicLoading, $compile, $cordovaGeolocation,GetDeviceInfo,CurrentLocation) {

   console.log("app controller");
    $scope.username = AuthService.username();
    $scope.$on(AUTH_EVENTS.notAuthenticated, function(event) {
    $scope.setCurrentUsername = function(name) {
        $scope.username = name;


this is my index.html

<body ng-app="app" ng-controller="AppCtrl">

this is app.js file

.config(function($stateProvider, $urlRouterProvider,USER_ROLES) {

        .state('home', {
            url: "/home",
            templateUrl: "templates/home.html",
            controller: 'AppCtrl'
        .state('login', {
            url: "/login",
            controller: 'LoginCtrl',
            templateUrl: "templates/login.html"
        .state('main', {
            url: "/main",
            controller: 'MainCtrl',
            templateUrl: "templates/main.html"

    // if none of the above states are matched, use this as the fallback


Dont’ depend on Auto Hide for the splashscreen, and make it
yourself at the end of authentication function.

For iOS:

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

For Android:
set a large number for the splash screen delay time, like 1 minute

The command to hide for both:




I hope thats help
Good Luck


thank you @ayman .i will try.