mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-30 09:32:50 +01:00
refactor: migrate app.config and Expo config plugins to TypeScript (#1718)
This commit is contained in:
31
plugins/withTVOSAppIcon.ts
Normal file
31
plugins/withTVOSAppIcon.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { type ConfigPlugin, withXcodeProject } from "expo/config-plugins";
|
||||
|
||||
const withTVOSAppIcon: ConfigPlugin = (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;
|
||||
});
|
||||
};
|
||||
|
||||
export default withTVOSAppIcon;
|
||||
Reference in New Issue
Block a user