Forked from sean-hill/Hide Splashscreen in Ionic App
Created
January 23, 2016 12:12
-
-
Save lykmapipo/08b523e4166d9c24b701 to your computer and use it in GitHub Desktop.
Hide Splashscreen in Ionic App with ngCordova
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment