wip: build for tv

This commit is contained in:
Fredrik Burmester
2026-01-16 10:47:48 +01:00
parent 55b897883b
commit e10a99cc48
10 changed files with 50 additions and 5 deletions

View File

@@ -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",
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
assets/images/icon-tvos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -133,6 +133,7 @@ const _InfoRow: React.FC<{ label: string; value: string }> = ({
</View>
);
// Export as both ItemContentTV (for direct requires) and ItemContent (for platform-resolved imports)
export const ItemContentTV: React.FC<ItemContentTVProps> = React.memo(
({ item, itemWithSources }) => {
const [api] = useAtom(apiAtom);
@@ -608,3 +609,6 @@ export const ItemContentTV: React.FC<ItemContentTVProps> = React.memo(
);
},
);
// Alias for platform-resolved imports (tvOS auto-resolves .tv.tsx files)
export const ItemContent = ItemContentTV;

View File

@@ -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;