Skip to content

Integration requirements

How the game talks to the SDK and the host channel. Channel‑specific extras live on the channel pages.

  • MUST load frvr-sdk.min.js (and frvr-channel-dev.min.js in dev) before any code touches window.FRVR.
  • MUST populate FRVR.config and wire every lifecycle hook before FRVR.init(). See start/overview.
  • MUST call FRVR.bootstrapper.init() → load assets → FRVR.bootstrapper.complete().

All five MUST be implemented:

HookTrigger
onSuspendStop the game loop (interstitial, app backgrounded)
onResumeResume the game loop
onAudioSuspendMute / pause audio
onAudioResumeRestore audio
onGamePausePlayer invoked an explicit pause

Per‑engine wiring: Web · Unity · Cocos · Construct 3.

  • 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. onResume is 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.
  • MUST persist progress at meaningful checkpoints via FRVR.cloudStorage. Cloud is canonical: it survives device changes and channel‑level wipes.
  • SHOULD also use FRVR.localStorage for 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.localStorage directly.
  • MUST load cloud state before writing to it.
  • SHOULD keep payloads small. See Stability for limits.

If the game submits a “best score”, the value MUST match what the player sees in‑game.