Integration requirements
How the game talks to the SDK and the host channel. Channel‑specific extras live on the channel pages.
Initialization order
Section titled “Initialization order”- MUST load
frvr-sdk.min.js(andfrvr-channel-dev.min.jsin dev) before any code toucheswindow.FRVR. - MUST populate
FRVR.configand wire every lifecycle hook beforeFRVR.init(). See start/overview. - MUST call
FRVR.bootstrapper.init()→ load assets →FRVR.bootstrapper.complete().
Lifecycle hooks
Section titled “Lifecycle hooks”All five MUST be implemented:
| Hook | Trigger |
|---|---|
onSuspend | Stop the game loop (interstitial, app backgrounded) |
onResume | Resume the game loop |
onAudioSuspend | Mute / pause audio |
onAudioResume | Restore audio |
onGamePause | Player invoked an explicit pause |
Per‑engine wiring: Web · Unity · Cocos · Construct 3.
Pause is exclusive to the SDK
Section titled “Pause is exclusive to the SDK”- MUST NOT drive pause from the Page Visibility API,
blur/focus,pagehide, or equivalents. - Pause means everything stops: game loop, audio, network, animations, timers, rendering.
onResumeis the only valid wake path.
- MUST route all audio through hooks the channel can mute (lifecycle audio hooks; in Unity / Cocos, the engine’s master mixer).
- MUST NOT play audio before user interaction.
Save data
Section titled “Save data”- MUST persist progress at meaningful checkpoints via
FRVR.cloudStorage. Cloud is canonical: it survives device changes and channel‑level wipes. - SHOULD also use
FRVR.localStoragefor high‑frequency or transient writes (in‑level checkpoints, UI prefs, throttle counters). Cloud writes have rate limits; local writes are cheap. - Pattern: write local on every state change; write cloud at coarser checkpoints and on
onSuspend. - MUST NOT use cookies, IndexedDB, or
window.localStoragedirectly. - MUST load cloud state before writing to it.
- SHOULD keep payloads small. See Stability for limits.
Score submission
Section titled “Score submission”If the game submits a “best score”, the value MUST match what the player sees in‑game.