diff --git a/app.json b/app.json index 38b77a23..a95ce470 100644 --- a/app.json +++ b/app.json @@ -36,10 +36,6 @@ "icon": "./assets/images/icon-ios-liquid-glass.icon", "appleTeamId": "MWD5K362T8" }, - "tvos": { - "icon": "./assets/images/icon.png", - "bundleIdentifier": "com.fredrikburmester.streamyfin" - }, "android": { "jsEngine": "hermes", "versionCode": 92, @@ -59,7 +55,20 @@ "googleServicesFile": "./google-services.json" }, "plugins": [ - "@react-native-tvos/config-tv", + [ + "@react-native-tvos/config-tv", + { + "appleTVImages": { + "icon": "./assets/images/icon-tvos.png", + "iconSmall": "./assets/images/icon-tvos-small.png", + "iconSmall2x": "./assets/images/icon-tvos-small-2x.png", + "topShelf": "./assets/images/icon-tvos-topshelf.png", + "topShelf2x": "./assets/images/icon-tvos-topshelf-2x.png", + "topShelfWide": "./assets/images/icon-tvos-topshelf-wide.png", + "topShelfWide2x": "./assets/images/icon-tvos-topshelf-wide-2x.png" + } + } + ], "expo-router", "expo-font", "./plugins/withExcludeMedia3Dash.js", @@ -125,6 +134,7 @@ ["./plugins/withAndroidManifest.js"], ["./plugins/withTrustLocalCerts.js"], ["./plugins/withGradleProperties.js"], + ["./plugins/withTVOSAppIcon.js"], [ "./plugins/withGitPod.js", { diff --git a/assets/images/icon-tvos-small-2x.png b/assets/images/icon-tvos-small-2x.png new file mode 100644 index 00000000..497cfd4b Binary files /dev/null and b/assets/images/icon-tvos-small-2x.png differ diff --git a/assets/images/icon-tvos-small.png b/assets/images/icon-tvos-small.png new file mode 100644 index 00000000..d822f1c2 Binary files /dev/null and b/assets/images/icon-tvos-small.png differ diff --git a/assets/images/icon-tvos-topshelf-2x.png b/assets/images/icon-tvos-topshelf-2x.png new file mode 100644 index 00000000..15f077e3 Binary files /dev/null and b/assets/images/icon-tvos-topshelf-2x.png differ diff --git a/assets/images/icon-tvos-topshelf-wide-2x.png b/assets/images/icon-tvos-topshelf-wide-2x.png new file mode 100644 index 00000000..69cdddf5 Binary files /dev/null and b/assets/images/icon-tvos-topshelf-wide-2x.png differ diff --git a/assets/images/icon-tvos-topshelf-wide.png b/assets/images/icon-tvos-topshelf-wide.png new file mode 100644 index 00000000..6758a544 Binary files /dev/null and b/assets/images/icon-tvos-topshelf-wide.png differ diff --git a/assets/images/icon-tvos-topshelf.png b/assets/images/icon-tvos-topshelf.png new file mode 100644 index 00000000..f78c3cc2 Binary files /dev/null and b/assets/images/icon-tvos-topshelf.png differ diff --git a/assets/images/icon-tvos.png b/assets/images/icon-tvos.png new file mode 100644 index 00000000..2e0764c4 Binary files /dev/null and b/assets/images/icon-tvos.png differ diff --git a/components/ItemContent.tv.tsx b/components/ItemContent.tv.tsx index bd075b9c..48647ce6 100644 --- a/components/ItemContent.tv.tsx +++ b/components/ItemContent.tv.tsx @@ -133,6 +133,7 @@ const _InfoRow: React.FC<{ label: string; value: string }> = ({ ); +// Export as both ItemContentTV (for direct requires) and ItemContent (for platform-resolved imports) export const ItemContentTV: React.FC = React.memo( ({ item, itemWithSources }) => { const [api] = useAtom(apiAtom); @@ -608,3 +609,6 @@ export const ItemContentTV: React.FC = React.memo( ); }, ); + +// Alias for platform-resolved imports (tvOS auto-resolves .tv.tsx files) +export const ItemContent = ItemContentTV; diff --git a/plugins/withTVOSAppIcon.js b/plugins/withTVOSAppIcon.js new file mode 100644 index 00000000..50114eb6 --- /dev/null +++ b/plugins/withTVOSAppIcon.js @@ -0,0 +1,31 @@ +const { withXcodeProject } = require("@expo/config-plugins"); + +const withTVOSAppIcon = (config) => { + // Only apply for TV builds + if (process.env.EXPO_TV !== "1") { + return config; + } + + return withXcodeProject(config, async (config) => { + const xcodeProject = config.modResults; + + const buildConfigurations = xcodeProject.pbxXCBuildConfigurationSection(); + + for (const key in buildConfigurations) { + const buildConfig = buildConfigurations[key]; + if ( + typeof buildConfig === "object" && + buildConfig.buildSettings && + buildConfig.buildSettings.PRODUCT_NAME + ) { + // Set the tvOS app icon + buildConfig.buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME = + "TVAppIcon"; + } + } + + return config; + }); +}; + +module.exports = withTVOSAppIcon;