Search Documentation

Search guides, functions, classes, interfaces, and more

Splash lifecycle

How the native app and splash HTML page talk during startup.

Sequence

  1. Native loads splash from disk (boot miniapp splash/ folder, or embedded splash.zip).
  2. Page loads @mobyapps/splashwindow.splash.
  3. Native calls splash.update({ id, miniapps, error, … }) as miniapp sync progresses.
  4. Your handler updates UI and, when ready, calls splash.complete(id).
  5. Native continues (loads the boot miniapp) after complete for non-zero ids.

Rules

RuleDetail
Confirm every updateFor id !== 0, call complete(id) exactly once when that step is done
Own animation timingNative waits — do not let the default handler fire (it completes immediately)
id === 0Initial “show splash”; usually do not complete
skipcomplete(id) immediately
offline / empty / all doneWait remaining min_animation_time, then complete(id)
Partial progressUpdate UI (done/total); wait for a later update
FallbackIf 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-04FR-SP-06).