import type { ConfigContext, ExpoConfig } from 'expo/config'; /** * app.json holds the real config; this only adds build-time switches. * * Local test builds point at a dev server over plain http://, which Android * blocks by default in release builds. Allow cleartext only when the API URL * itself is http://, so store builds (https) stay locked down. */ export default ({ config }: ConfigContext): ExpoConfig => { const apiUrl = process.env.EXPO_PUBLIC_API_URL ?? ''; const localHttp = apiUrl.startsWith('http://'); return { ...(config as ExpoConfig), plugins: [ ...(config.plugins ?? []), ['expo-build-properties', { android: { usesCleartextTraffic: localHttp } }], ], }; };