From 84d7ad72a631c02b7c14b55c1820a273b0ede3ac Mon Sep 17 00:00:00 2001 From: Uruk Date: Fri, 26 Sep 2025 19:41:51 +0200 Subject: [PATCH] fix: conditionally load TV plugin based on build target Moves TV-specific plugin configuration from static app.json to dynamic loading in app.config.js based on EXPO_TV environment variable. Ensures TV plugin only loads for TV builds while phone-specific plugins load for non-TV builds, preventing conflicts between different build targets. --- app.config.js | 6 +++++- app.json | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app.config.js b/app.config.js index 6621e022..485bf969 100644 --- a/app.config.js +++ b/app.config.js @@ -1,5 +1,9 @@ module.exports = ({ config }) => { - if (process.env.EXPO_TV !== "1") { + if (process.env.EXPO_TV === "1") { + // Add TV-specific plugin for TV builds + config.plugins.push("@react-native-tvos/config-tv"); + } else { + // Add non-TV specific plugins for phone builds config.plugins.push("expo-background-task"); config.plugins.push([ diff --git a/app.json b/app.json index 3119300d..e32e4be6 100644 --- a/app.json +++ b/app.json @@ -53,7 +53,6 @@ "googleServicesFile": "./google-services.json" }, "plugins": [ - "@react-native-tvos/config-tv", "expo-router", "expo-font", [