Last active
April 16, 2017 17:25
-
-
Save sean-hill/e4b97c30ff628d3ae694 to your computer and use it in GitHub Desktop.
Hide Splashscreen in Ionic App with ngCordova
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your App | |
angular.module('your-app', ['ionic', 'ngCordova']) | |
.config(function($stateProvider, $urlRouterProvider, $httpProvider) { | |
$stateProvider | |
.state("home", { | |
url: "/home", | |
controller: "HomeCtrl", | |
templateUrl: "templates/home.html", | |
resolve: { | |
splash: function(AppInit) { | |
return AppInit.splash(); | |
} | |
} | |
}) | |
// Fallback to this route | |
$urlRouterProvider.otherwise("/home"); | |
}) | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.factory('AppInit', function ($q, $cordovaSplashscreen, $ionicPlatform, $timeout) { | |
return { | |
splash: function() { | |
var deferred = $q.defer(); | |
$ionicPlatform.ready(function(){ | |
$timeout(function(){ | |
$cordovaSplashscreen.hide(); | |
deferred.resolve(); | |
}, 500); | |
}); | |
return deferred.promise; | |
} | |
}; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<widget id="com.ionicframework.tabs158846" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> | |
<name>tabs</name> | |
<description> | |
An Ionic Framework and Cordova project. | |
</description> | |
<author email="hi@ionicframework" href="http://ionicframework.com/"> | |
Ionic Framework Team | |
</author> | |
<content src="index.html"/> | |
<access origin="*"/> | |
<preference name="webviewbounce" value="false"/> | |
<preference name="UIWebViewBounce" value="false"/> | |
<preference name="DisallowOverscroll" value="true"/> | |
<preference name="BackupWebStorage" value="none"/> | |
<!-- IMPORTANT (Make sure to add splashscreen plugin too) --> | |
<preference name="AutoHideSplashScreen" value="false"/> | |
<preference name="ShowSplashScreenSpinner" value="false"/> | |
<!-- IMPORTANT --> | |
<feature name="StatusBar"> | |
<param name="ios-package" value="CDVStatusBar" onload="true"/> | |
</feature> | |
</widget> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hide Splashscreen in Ionic App |
This was a great help. I had to spent so many hours to find the fix.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this! Works great! I spent hours trying to get this to work in other ways.