add staging ios app build script

This commit is contained in:
Kevin
2026-05-20 10:27:40 +08:00
parent 0d417331fd
commit 81458c7046
14 changed files with 102 additions and 31 deletions

View File

@@ -12,11 +12,21 @@ function resolveAppVariant(): AppVariant {
if (__DEV__) {
return 'development';
}
// Release 包若 env 未写入 APP_VARIANT例如仅复制了 env/staging 到 .env 但变量缺失),
// 仍按 API 是否为 http 推断预发,避免关于页误隐藏后端地址。
const apiUrl = process.env.EXPO_PUBLIC_API_URL ?? '';
if (apiUrl.startsWith('http://')) {
return 'staging';
}
return 'production';
}
/** Shown on About screen for dev/staging builds only. */
/** Shown on About screen for dev/staging builds only (never production Release). */
export function shouldShowAboutBackendUrl(variant: AppVariant = appVariant): boolean {
// Metro / 调试包:始终显示,避免 .env 误用 production variant 时看不到实际 API
if (__DEV__) {
return true;
}
return variant === 'development' || variant === 'staging';
}