TV traps
Where web or mobile intuition fails with an in-app SDK on TV.
- Reload is not relaunch. A reload (
location.reload(), Metro, browser refresh) keeps the launch: the new page reads the same payload and reconnects with its token, and toets waits for it. The launch's state and flags apply again, as on a cold start. Onlyapp.launch()gives a fresh launch, and only one page per launch can be connected. - Cleartext localhost. The SDK talks
ws://localhost. Android release-like builds block cleartext unlessnetwork_security_configallowslocalhost; iOS/tvOS ATS needsNSAllowsLocalNetworking. - Loopback only. The SDK refuses a non-loopback
sdkUrlby default (a crafted deep link must not exfiltrate the UI). Devices reach the host throughadb reverseor the simulator's shared network, solocalhostis always right. - Focus without DOM focus. JS focus engines keep focus in app state and only style the focused element. Report it with
reportFocus()(focus.md) or the SDK reports DOM focus, usually nothing. - Endless motion. Shimmers, ambient video and carousels keep apps busy. Infinite animations are ignored; ignore the rest explicitly (idle.md).
- Old engines. Smart TV browsers can be years behind; the SDK targets ES2015. Polyfill
Promise/WeakMaponly if the engine predates them. - Ship it out. Exclude the SDK from production builds (production.md).