Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

withAndroidCleartextTraffic.cjs

18 lines559 Bytes

1const { withAndroidManifest } = require("expo/config-plugins");
2​
3module.exports = function withAndroidCleartextTraffic(config) {
4 return withAndroidManifest(config, (nextConfig) => {
5 const application = nextConfig.modResults.manifest.application?.[0];
6​
7 if (application == null) {
8 throw new Error(
9 "AndroidManifest.xml is missing the application element required for cleartext traffic configuration.",
10 );
11 }
12​
13 application.$ ??= {};
14 application.$["android:usesCleartextTraffic"] = "true";
15​
16 return nextConfig;
17 });
18};