michael@0: michael@0: michael@0: # org.apache.cordova.splashscreen michael@0: michael@0: This plugin displays and hides a splash screen during application launch. michael@0: michael@0: ## Installation michael@0: michael@0: cordova plugin add org.apache.cordova.splashscreen michael@0: michael@0: michael@0: ## Supported Platforms michael@0: michael@0: - Amazon Fire OS michael@0: - Android michael@0: - BlackBerry 10 michael@0: - iOS michael@0: - Windows Phone 7 and 8 michael@0: - Windows 8 michael@0: michael@0: michael@0: ## Methods michael@0: michael@0: - splashscreen.show michael@0: - splashscreen.hide michael@0: michael@0: ### Android Quirks michael@0: michael@0: In your config.xml, you need to add the following preferences: michael@0: michael@0: michael@0: michael@0: michael@0: Where foo is the name of the splashscreen file, preferably a 9 patch file. Make sure to add your splashcreen files to your res/xml directory under the appropriate folders. The second parameter represents how long the splashscreen will appear in milliseconds. It defaults to 3000 ms. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) michael@0: for more information. michael@0: michael@0: ## splashscreen.hide michael@0: michael@0: Dismiss the splash screen. michael@0: michael@0: navigator.splashscreen.hide(); michael@0: michael@0: michael@0: ### BlackBerry 10, WP8, iOS Quirk michael@0: michael@0: The `config.xml` file's `AutoHideSplashScreen` setting must be michael@0: `false`. To delay hiding the splash screen for two seconds, add a michael@0: timer such as the following in the `deviceready` event handler: michael@0: michael@0: setTimeout(function() { michael@0: navigator.splashscreen.hide(); michael@0: }, 2000); michael@0: michael@0: ## splashscreen.show michael@0: michael@0: Displays the splash screen. michael@0: michael@0: navigator.splashscreen.show(); michael@0: michael@0: michael@0: Your application cannot call `navigator.splashscreen.show()` until the app has michael@0: started and the `deviceready` event has fired. But since typically the splash michael@0: screen is meant to be visible before your app has started, that would seem to michael@0: defeat the purpose of the splash screen. Providing some configuration in michael@0: `config.xml` will automatically `show` the splash screen immediately after your michael@0: app launch and before it has fully started and received the `deviceready` michael@0: event. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) michael@0: for more information on doing this configuration. For this reason, it is michael@0: unlikely you need to call `navigator.splashscreen.show()` to make the splash michael@0: screen visible for app startup. michael@0: