Skip to content

Add Vega (Amazon Fire TV) support - #808

Open
kalenkou wants to merge 1 commit into
zoontek:masterfrom
kalenkou:feat/vega-support
Open

kalenkou wants to merge 1 commit into
zoontek:masterfrom
kalenkou:feat/vega-support

Conversation

@kalenkou

Copy link
Copy Markdown

Summary

This PR adds Vega support. Vega is the React Native platform of the newer Amazon Fire TV devices (React Native for Vega, RN 0.83). Today react-native-bootsplash crashes there at import, because TurboModuleRegistry.getEnforcing("RNBootSplash") finds no native module. RN 0.83 for Vega has no splash screen library at all: Amazon lists expo-splash-screen as not supported, and Vega apps write their own splash code.

Vega already has a native splash screen. The system shows assets/raw/SplashScreenImages.zip at launch and hides it on the first frame. Its SplashScreenManager module can keep it until the app hides it. This PR uses that, so there is no native code:

  • src/specs/NativeRNBootSplash.kepler.ts. Metro picks .kepler files on Vega, as it picks .web files on the web. It reads the root tag of the app with AppRegistry.setWrapperComponentProvider, calls preventAutoHideV2(rootTag) before the first render, and hide() calls hideV2(rootTag). The logic lives in src/specs/vegaSplash.ts with no React Native import, so Node can test it.
  • A vega platform for the CLI. --platforms=vega writes assets/raw/SplashScreenImages.zip: one 1920x1080 frame (the background and the logo, 2 px per dp as on a Fire TV) and the desc.txt that Vega reads. A small zip writer (stored files, as the PNG is compressed already) avoids a new dependency.
  • vega is not in the default platforms.
  • A Vega section in the README.

Why the root tag: on RN 0.83, SplashScreenManager.preventAutoHideAsync(moduleName) fails with "No registered splash screen for module". The documented hooks (usePreventHideSplashScreen) use the root tag. This PR uses it too, without a hook.

Test Plan

  • yarn test, new, with the Node test runner and no new dependency: 14 tests.
    • The spec: the splash is kept on the first start and hidden on hide(). Also a LogBox start, hide() before the start, a missing native module, errors from the native module and dark mode.
    • The zip and the frame: CRCs, local and central headers, the descriptor, the frame size, the background pixel and the logo pixels.
    • I broke each covered line on purpose and checked that a test fails.
  • yarn typecheck, yarn lint and prettier --check . pass.
  • Fire TV Stick 4K Select, Vega OS, RN 0.83, a release build. The app only calls BootSplash.hide({ fade: true }) 10 s after mount. The splash made by the CLI from example/svgs/light-logo.svg stays on screen after the first frame, and the app shows right after hide(). The system log agrees. The splash service shows the splash at +0 s and the app mounts at +2.0 s. hide() resolves at +12.0 s, and the app comes to the foreground at +12.4 s.

What's required for testing (prerequisites)?

A Fire TV with Vega OS in developer mode, and the Vega SDK. The Vega Virtual Device shows no splash screen. Use a release build: in debug builds Vega hides the splash on its own.

What are the steps to test it (after prerequisites)?

  1. In a Vega app, run npx react-native-bootsplash generate logo.png --platforms=vega.
  2. Call BootSplash.hide() when the app is ready.
  3. Run npm run build:release, then vega run-app <vpkg> -d <device>.

Compatibility

OS Implemented
iOS ✅
Android ✅
Vega ✅

Checklist

  • I have tested this on a device and a simulator (on a Fire TV. The Vega simulator shows no splash screen.)
  • I added the documentation in README.md
  • I added a sample use of the API in the example project (example/App.tsx). The example has no Vega target. I can add one if you want it.

@kalenkou
kalenkou requested a review from zoontek as a code owner October 22, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant