api/internal/gamification/game_bridge library

Classes

GameBridge
Owns the bridge session at the envelope level: the ready handshake (repeated ready re-sends the same init), the ready timeout, and closing. Typed dispatch lives in GameBridgeSession; this only tracks whether the surface may still talk to the skin.

Enums

GameBridgeResult
How the bridge disposed of one intake.
GameFailureReason
Failures that close a game surface, sent as game_open_failed reasons by wireValue.
GameSessionState
One open game: ready (→ init) and close. Survives the whole surface lifetime.

Constants

deviceFactsPollMs → const int
How often an open game re-collects device facts so thermal, power-save and reduced-motion changes push without a viewport change. Pushes fire only when the pushed subset changed, so the tick is one cheap collect.
gameBridgeVersion → const int
The bridge version this SDK speaks. A skin declaring a newer one is never opened.
gameHttpMaxInFlight → const int
Most skin http calls one game may have in flight at once. A reused id or a call past the cap answers bad_request, like Android.
gameHttpWatchdogMs → const int
Bound for one skin http call that a shown game waits on (state, play, getRewards): the http layer already answers error timeout at 20 s, so a call still pending here means the native stack hung and will never answer. 30 s = the 20 s http timeout plus headroom for timer slop on low-end devices and a full skin busy-retry cycle, so a healthy-but-slow call is always answered first. Same value on Android (GAME_HTTP_WATCHDOG_MS) and iOS (GameBridge.httpWatchdogSeconds); the stuck game closes instead of freezing.
gameLoadTimeoutMs → const int
Page load budget: load start → page commit, else quiet close with load_timeout. Matches Android (GAME_LOAD_TIMEOUT_MS) and iOS.
gameMaxMessageBytes → const int
Skin messages over this are dropped. Fits a full 16 KB storage.set value or http body plus its envelope.
gameReadyTimeoutMs → const int
Ready handshake budget: page commit → ready, else quiet close.