Search Documentation
Search guides, functions, classes, interfaces, and more
Splash lifecycle
How the native app and splash HTML page talk during startup.
Sequence
- Native loads splash from disk (boot miniapp
splash/folder, or embeddedsplash.zip). - Page loads
@mobyapps/splash→window.splash. - Native calls
splash.update({ id, miniapps, error, … })as miniapp sync progresses. - Your handler updates UI and, when ready, calls
splash.complete(id). - Native continues (loads the boot miniapp) after
completefor non-zero ids.
Rules
| Rule | Detail |
|---|---|
| Confirm every update | For id !== 0, call complete(id) exactly once when that step is done |
| Own animation timing | Native waits — do not let the default handler fire (it completes immediately) |
id === 0 | Initial “show splash”; usually do not complete |
skip | complete(id) immediately |
offline / empty / all done | Wait remaining min_animation_time, then complete(id) |
| Partial progress | Update UI (done/total); wait for a later update |
| Fallback | If no updates arrive, complete(0) after a timeout (e.g. 4s) |
Handler example
window.splash.events.on('update', async (data) => { if (data.skip) { window.splash.complete(data.id) return } // … progress UI, min animation sleep … if (data.id !== 0) { window.splash.complete(data.id) } })
Why confirmation matters
If the page does not call complete, native cannot safely advance — and if it completed without waiting, your intro animation would be cut off. The handshake keeps you in control of when the splash dismisses.
See splash platform spec / docs/spec/splash/splash-platform.md in the SDK repo (FR-SP-04–FR-SP-06).