fix:修复

This commit is contained in:
吕新雨
2026-02-05 16:06:49 +08:00
parent 2b67a571bb
commit 8e71503169
18 changed files with 924 additions and 22 deletions

View File

@@ -100,6 +100,8 @@ function getExpoProjectId(): string | undefined {
// 兼容 app.json / app.config.ts 的 extra.eas.projectId
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Constants.expoConfig as any)?.extra?.eas?.projectId ||
// 兜底:某些运行时环境仍可直接读到 EXPO_PUBLIC_ 注入
process.env.EXPO_PUBLIC_EAS_PROJECT_ID ||
undefined
);
}
@@ -115,7 +117,7 @@ export async function getExpoPushTokenOrThrow(): Promise<string> {
const msg = e instanceof Error ? e.message : String(e);
const hint = projectId
? ''
: '(可能缺少 EAS projectId,建议在 app.json 的 extra.eas.projectId 配置后重试)';
: '(可能缺少 EAS projectId:请在 .env.local 配置 EXPO_PUBLIC_EAS_PROJECT_ID或在 app.json/app.config.ts 的 extra.eas.projectId 写入后重试)';
throw new Error(`获取 Expo Push Token 失败:${msg}${hint}`);
}
}