Files
meteor/packages/launch-screen
Ben Newman 232ab2d209 Bump package versions for 1.4.2-beta.9 release.
I had to scrap the 1.4.2-beta.8 release because meteor-tool@1.4.2-beta.8
got published by a partial run of the publish-release script, but then the
publish-release script thought meteor-tool changed after that, and I
didn't want to republish it as something like 1.4.2-1-beta.8.
2016-10-05 18:42:56 -04:00
..
2014-10-13 17:30:50 -07:00
2016-08-30 15:40:14 -07:00

Launch Screen package

A mobile-only package that provides an API for postponing when your app's launch screen is removed and your app is made visible. For example, your app can avoid showing the user a white page while first rendering the UI.

Simple usage

// just add the package, no special configuration required

When this package is added, the app will hold the launch screen until the body template is rendered. If you're using iron:router in your app, it waits until the first route is rendered.

You can also control it manually if you want to wait on other UI elements to be loaded before releasing the launch screen and showing the user the actual app.

Additional waiting before releasing the launch screen

Source code of released version | Source code of development version


To wait on more events before releasing the launch screen, call var handle = LaunchScreen.hold() in the top-level of the client code of your app, and when you're ready to show the launch screen, call handle.release().

For example, to wait for a template to be rendered:

// in a client-only javascript file
var handle = LaunchScreen.hold();

Template.myUI.onRendered(function () {
  handle.release();
});

Your app, or packages used in your app, can call LaunchScreen.hold() multiple times. The launch screen will be removed once release has been called on all of the handles.